mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 07:37:11 +02:00
chore: remove application font setting
This commit is contained in:
parent
0bec9f742b
commit
166020723f
5 changed files with 1 additions and 32 deletions
|
@ -29,7 +29,6 @@ void initLang() {
|
|||
void initFonts() {
|
||||
auto settings = &AyuSettings::getInstance();
|
||||
|
||||
AyuFonts::setMainFont(settings->mainFont);
|
||||
AyuFonts::setMonoFont(settings->monoFont);
|
||||
}
|
||||
|
||||
|
|
|
@ -234,7 +234,6 @@ AyuGramSettings::AyuGramSettings() {
|
|||
showGhostToggleInTray = true;
|
||||
showStreamerToggleInTray = false;
|
||||
|
||||
mainFont = "";
|
||||
monoFont = "";
|
||||
|
||||
hideNotificationCounters = false;
|
||||
|
@ -412,10 +411,6 @@ void AyuGramSettings::set_showStreamerToggleInTray(bool val) {
|
|||
showStreamerToggleInTray = val;
|
||||
}
|
||||
|
||||
void AyuGramSettings::set_mainFont(QString val) {
|
||||
mainFont = val;
|
||||
}
|
||||
|
||||
void AyuGramSettings::set_monoFont(QString val) {
|
||||
monoFont = val;
|
||||
}
|
||||
|
|
|
@ -61,7 +61,6 @@ public:
|
|||
bool showGhostToggleInTray;
|
||||
bool showStreamerToggleInTray;
|
||||
|
||||
QString mainFont;
|
||||
QString monoFont;
|
||||
|
||||
bool hideNotificationCounters;
|
||||
|
@ -121,7 +120,6 @@ public:
|
|||
void set_showGhostToggleInTray(bool val);
|
||||
void set_showStreamerToggleInTray(bool val);
|
||||
|
||||
void set_mainFont(QString val);
|
||||
void set_monoFont(QString val);
|
||||
|
||||
void set_hideNotificationCounters(bool val);
|
||||
|
@ -172,7 +170,6 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(
|
|||
showStreamerToggleInDrawer,
|
||||
showGhostToggleInTray,
|
||||
showStreamerToggleInTray,
|
||||
mainFont,
|
||||
monoFont,
|
||||
hideNotificationCounters,
|
||||
hideAllChatsFolder,
|
||||
|
|
|
@ -665,7 +665,7 @@ void Content::setupContent(
|
|||
const std::vector<Font> &fonts) {
|
||||
using namespace rpl::mappers;
|
||||
|
||||
const auto current = AyuFonts::getMainFont();
|
||||
const auto current = AyuFonts::getMonoFont();
|
||||
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
|
||||
const auto add = [&](const std::vector<Font> &list)
|
||||
{
|
||||
|
|
|
@ -1068,28 +1068,6 @@ void SetupRecentStickersLimitSlider(not_null<Ui::VerticalLayout*> container) {
|
|||
void SetupFonts(not_null<Ui::VerticalLayout*> container, not_null<Window::SessionController*> controller) {
|
||||
const auto settings = &AyuSettings::getInstance();
|
||||
|
||||
const auto commonButton = AddButtonWithLabel(
|
||||
container,
|
||||
tr::ayu_MainFont(),
|
||||
rpl::single(
|
||||
settings->mainFont.isEmpty() ? tr::ayu_FontDefault(tr::now) : settings->mainFont
|
||||
),
|
||||
st::settingsButtonNoIcon);
|
||||
const auto commonGuard = Ui::CreateChild<base::binary_guard>(commonButton.get());
|
||||
|
||||
commonButton->addClickHandler(
|
||||
[=]
|
||||
{
|
||||
*commonGuard = AyuUi::FontSelectorBox::Show(controller,
|
||||
[=](QString font)
|
||||
{
|
||||
auto ayuSettings = &AyuSettings::getInstance();
|
||||
|
||||
ayuSettings->set_mainFont(std::move(font));
|
||||
AyuSettings::save();
|
||||
});
|
||||
});
|
||||
|
||||
const auto monoButton = AddButtonWithLabel(
|
||||
container,
|
||||
tr::ayu_MonospaceFont(),
|
||||
|
|
Loading…
Add table
Reference in a new issue