mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fixed handling of language switch for checkboxes in intro settings.
This commit is contained in:
parent
25d69434ec
commit
52cd9f8cbf
2 changed files with 17 additions and 13 deletions
|
@ -326,23 +326,27 @@ void SetupSpellchecker(
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupSystemIntegrationContent(not_null<Ui::VerticalLayout*> container) {
|
void SetupSystemIntegrationContent(not_null<Ui::VerticalLayout*> container) {
|
||||||
const auto checkbox = [&](const QString &label, bool checked) {
|
const auto checkbox = [&](rpl::producer<QString> &&label, bool checked) {
|
||||||
return object_ptr<Ui::Checkbox>(
|
return object_ptr<Ui::Checkbox>(
|
||||||
container,
|
container,
|
||||||
label,
|
std::move(label),
|
||||||
checked,
|
checked,
|
||||||
st::settingsCheckbox);
|
st::settingsCheckbox);
|
||||||
};
|
};
|
||||||
const auto addCheckbox = [&](const QString &label, bool checked) {
|
const auto addCheckbox = [&](
|
||||||
|
rpl::producer<QString> &&label,
|
||||||
|
bool checked) {
|
||||||
return container->add(
|
return container->add(
|
||||||
checkbox(label, checked),
|
checkbox(std::move(label), checked),
|
||||||
st::settingsCheckboxPadding);
|
st::settingsCheckboxPadding);
|
||||||
};
|
};
|
||||||
const auto addSlidingCheckbox = [&](const QString &label, bool checked) {
|
const auto addSlidingCheckbox = [&](
|
||||||
|
rpl::producer<QString> &&label,
|
||||||
|
bool checked) {
|
||||||
return container->add(
|
return container->add(
|
||||||
object_ptr<Ui::SlideWrap<Ui::Checkbox>>(
|
object_ptr<Ui::SlideWrap<Ui::Checkbox>>(
|
||||||
container,
|
container,
|
||||||
checkbox(label, checked),
|
checkbox(std::move(label), checked),
|
||||||
st::settingsCheckboxPadding));
|
st::settingsCheckboxPadding));
|
||||||
};
|
};
|
||||||
if (Platform::TrayIconSupported()) {
|
if (Platform::TrayIconSupported()) {
|
||||||
|
@ -352,7 +356,7 @@ void SetupSystemIntegrationContent(not_null<Ui::VerticalLayout*> container) {
|
||||||
|| (workMode == dbiwmWindowAndTray);
|
|| (workMode == dbiwmWindowAndTray);
|
||||||
};
|
};
|
||||||
const auto tray = addCheckbox(
|
const auto tray = addCheckbox(
|
||||||
tr::lng_settings_workmode_tray(tr::now),
|
tr::lng_settings_workmode_tray(),
|
||||||
trayEnabled());
|
trayEnabled());
|
||||||
|
|
||||||
const auto taskbarEnabled = [] {
|
const auto taskbarEnabled = [] {
|
||||||
|
@ -362,7 +366,7 @@ void SetupSystemIntegrationContent(not_null<Ui::VerticalLayout*> container) {
|
||||||
};
|
};
|
||||||
const auto taskbar = Platform::IsWindows()
|
const auto taskbar = Platform::IsWindows()
|
||||||
? addCheckbox(
|
? addCheckbox(
|
||||||
tr::lng_settings_workmode_window(tr::now),
|
tr::lng_settings_workmode_window(),
|
||||||
taskbarEnabled())
|
taskbarEnabled())
|
||||||
: nullptr;
|
: nullptr;
|
||||||
|
|
||||||
|
@ -406,7 +410,7 @@ void SetupSystemIntegrationContent(not_null<Ui::VerticalLayout*> container) {
|
||||||
}
|
}
|
||||||
if (Platform::AllowNativeWindowFrameToggle()) {
|
if (Platform::AllowNativeWindowFrameToggle()) {
|
||||||
const auto nativeFrame = addCheckbox(
|
const auto nativeFrame = addCheckbox(
|
||||||
tr::lng_settings_native_frame(tr::now),
|
tr::lng_settings_native_frame(),
|
||||||
Core::App().settings().nativeWindowFrame());
|
Core::App().settings().nativeWindowFrame());
|
||||||
|
|
||||||
nativeFrame->checkedChanges(
|
nativeFrame->checkedChanges(
|
||||||
|
@ -423,10 +427,10 @@ void SetupSystemIntegrationContent(not_null<Ui::VerticalLayout*> container) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto autostart = addCheckbox(
|
const auto autostart = addCheckbox(
|
||||||
tr::lng_settings_auto_start(tr::now),
|
tr::lng_settings_auto_start(),
|
||||||
cAutoStart());
|
cAutoStart());
|
||||||
const auto minimized = addSlidingCheckbox(
|
const auto minimized = addSlidingCheckbox(
|
||||||
tr::lng_settings_start_min(tr::now),
|
tr::lng_settings_start_min(),
|
||||||
minimizedToggled());
|
minimizedToggled());
|
||||||
|
|
||||||
autostart->checkedChanges(
|
autostart->checkedChanges(
|
||||||
|
@ -468,7 +472,7 @@ void SetupSystemIntegrationContent(not_null<Ui::VerticalLayout*> container) {
|
||||||
|
|
||||||
if (Platform::IsWindows() && !Platform::IsWindowsStoreBuild()) {
|
if (Platform::IsWindows() && !Platform::IsWindowsStoreBuild()) {
|
||||||
const auto sendto = addCheckbox(
|
const auto sendto = addCheckbox(
|
||||||
tr::lng_settings_add_sendto(tr::now),
|
tr::lng_settings_add_sendto(),
|
||||||
cSendToMenu());
|
cSendToMenu());
|
||||||
|
|
||||||
sendto->checkedChanges(
|
sendto->checkedChanges(
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 34eb5a8eb802dbbf9e5c9516e55a04af6b87aeb2
|
Subproject commit 697f2851b0625ae784e405e7fc596d1629e8668a
|
Loading…
Add table
Reference in a new issue