mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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() {
|
void initFonts() {
|
||||||
auto settings = &AyuSettings::getInstance();
|
auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
AyuFonts::setMainFont(settings->mainFont);
|
|
||||||
AyuFonts::setMonoFont(settings->monoFont);
|
AyuFonts::setMonoFont(settings->monoFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -234,7 +234,6 @@ AyuGramSettings::AyuGramSettings() {
|
||||||
showGhostToggleInTray = true;
|
showGhostToggleInTray = true;
|
||||||
showStreamerToggleInTray = false;
|
showStreamerToggleInTray = false;
|
||||||
|
|
||||||
mainFont = "";
|
|
||||||
monoFont = "";
|
monoFont = "";
|
||||||
|
|
||||||
hideNotificationCounters = false;
|
hideNotificationCounters = false;
|
||||||
|
@ -412,10 +411,6 @@ void AyuGramSettings::set_showStreamerToggleInTray(bool val) {
|
||||||
showStreamerToggleInTray = val;
|
showStreamerToggleInTray = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AyuGramSettings::set_mainFont(QString val) {
|
|
||||||
mainFont = val;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AyuGramSettings::set_monoFont(QString val) {
|
void AyuGramSettings::set_monoFont(QString val) {
|
||||||
monoFont = val;
|
monoFont = val;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,6 @@ public:
|
||||||
bool showGhostToggleInTray;
|
bool showGhostToggleInTray;
|
||||||
bool showStreamerToggleInTray;
|
bool showStreamerToggleInTray;
|
||||||
|
|
||||||
QString mainFont;
|
|
||||||
QString monoFont;
|
QString monoFont;
|
||||||
|
|
||||||
bool hideNotificationCounters;
|
bool hideNotificationCounters;
|
||||||
|
@ -121,7 +120,6 @@ public:
|
||||||
void set_showGhostToggleInTray(bool val);
|
void set_showGhostToggleInTray(bool val);
|
||||||
void set_showStreamerToggleInTray(bool val);
|
void set_showStreamerToggleInTray(bool val);
|
||||||
|
|
||||||
void set_mainFont(QString val);
|
|
||||||
void set_monoFont(QString val);
|
void set_monoFont(QString val);
|
||||||
|
|
||||||
void set_hideNotificationCounters(bool val);
|
void set_hideNotificationCounters(bool val);
|
||||||
|
@ -172,7 +170,6 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(
|
||||||
showStreamerToggleInDrawer,
|
showStreamerToggleInDrawer,
|
||||||
showGhostToggleInTray,
|
showGhostToggleInTray,
|
||||||
showStreamerToggleInTray,
|
showStreamerToggleInTray,
|
||||||
mainFont,
|
|
||||||
monoFont,
|
monoFont,
|
||||||
hideNotificationCounters,
|
hideNotificationCounters,
|
||||||
hideAllChatsFolder,
|
hideAllChatsFolder,
|
||||||
|
|
|
@ -665,7 +665,7 @@ void Content::setupContent(
|
||||||
const std::vector<Font> &fonts) {
|
const std::vector<Font> &fonts) {
|
||||||
using namespace rpl::mappers;
|
using namespace rpl::mappers;
|
||||||
|
|
||||||
const auto current = AyuFonts::getMainFont();
|
const auto current = AyuFonts::getMonoFont();
|
||||||
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
|
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
|
||||||
const auto add = [&](const std::vector<Font> &list)
|
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) {
|
void SetupFonts(not_null<Ui::VerticalLayout*> container, not_null<Window::SessionController*> controller) {
|
||||||
const auto settings = &AyuSettings::getInstance();
|
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(
|
const auto monoButton = AddButtonWithLabel(
|
||||||
container,
|
container,
|
||||||
tr::ayu_MonospaceFont(),
|
tr::ayu_MonospaceFont(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue