refactor: consolidate font picking into one dialog (#6531)
Instead of three separate dropdowns in the setting dialog, we now expose a single label + button combo for modifying the font. When the button is pressed, we open a custom font dialog allowing the user to customize the font family, font size, and font weight. Reviewed-by: nerix <nerixdev@outlook.de> Reviewed-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/ChatterinoSetting.hpp"
|
||||
#include "util/SignalListener.hpp"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QWidget>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class FontSettingDialog;
|
||||
|
||||
/// FontSettingWidget includes a label showing the current font and its size, with a button
|
||||
/// that opens a FontSettingDialog
|
||||
class FontSettingWidget : public QWidget
|
||||
{
|
||||
public:
|
||||
FontSettingWidget(QStringSetting &family, IntSetting &size,
|
||||
IntSetting &weight, QWidget *parent = nullptr);
|
||||
|
||||
private:
|
||||
void updateCurrentLabel();
|
||||
void showDialog();
|
||||
|
||||
FontSettingDialog *dialog = nullptr;
|
||||
|
||||
QStringSetting &familySetting;
|
||||
IntSetting &sizeSetting;
|
||||
IntSetting &weightSetting;
|
||||
|
||||
QLabel *currentLabel;
|
||||
SignalListener listener;
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
Reference in New Issue
Block a user