mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Add some icons to Advanced settings.
This commit is contained in:
parent
3c2caeb43a
commit
f5b8683b33
8 changed files with 64 additions and 29 deletions
BIN
Telegram/Resources/icons/settings/download.png
Normal file
BIN
Telegram/Resources/icons/settings/download.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 309 B |
BIN
Telegram/Resources/icons/settings/download@2x.png
Normal file
BIN
Telegram/Resources/icons/settings/download@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 459 B |
BIN
Telegram/Resources/icons/settings/download@3x.png
Normal file
BIN
Telegram/Resources/icons/settings/download@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 640 B |
|
@ -68,7 +68,7 @@ settingsIconEmoji: icon {{ "settings/emoji", settingsIconFg }};
|
|||
settingsIconThemes: icon {{ "settings/palette", settingsIconFg }};
|
||||
settingsIconGroup: icon {{ "settings/group", settingsIconFg }};
|
||||
settingsIconChannel: icon {{ "settings/channel", settingsIconFg }};
|
||||
settingsIconContacts: icon {{ "settings/user", settingsIconFg }};
|
||||
settingsIconUser: icon {{ "settings/user", settingsIconFg }};
|
||||
settingsIconSavedMessages: icon {{ "settings/saved_messages", settingsIconFg }};
|
||||
settingsIconKey: icon {{ "settings/key", settingsIconFg }};
|
||||
settingsIconReload: icon {{ "settings/reload", settingsIconFg }};
|
||||
|
@ -88,6 +88,7 @@ settingsIconSound: icon {{ "settings/sound", settingsIconFg }};
|
|||
settingsIconDock: icon {{ "settings/dock", settingsIconFg }};
|
||||
settingsIconPosition: icon {{ "settings/position", settingsIconFg }};
|
||||
settingsIconPin: icon {{ "settings/pin", settingsIconFg }};
|
||||
settingsIconDownload: icon {{ "settings/download", settingsIconFg }};
|
||||
|
||||
settingsSetPhotoSkip: 7px;
|
||||
|
||||
|
|
|
@ -74,7 +74,8 @@ void SetupConnectionType(
|
|||
// Handle language switch.
|
||||
tr::lng_connection_auto_connecting() | rpl::to_empty
|
||||
) | rpl::map(connectionType),
|
||||
st::settingsButtonNoIcon);
|
||||
st::settingsButton,
|
||||
{ &st::settingsIconArrows, kIconGreen });
|
||||
button->addClickHandler([=] {
|
||||
controller->show(ProxiesBoxController::CreateOwningBox(account));
|
||||
});
|
||||
|
@ -747,14 +748,6 @@ void Advanced::setupContent(not_null<Window::SessionController*> controller) {
|
|||
if (!cAutoUpdate()) {
|
||||
addUpdate();
|
||||
}
|
||||
addDivider();
|
||||
AddSkip(content);
|
||||
AddSubsectionTitle(content, tr::lng_settings_network_proxy());
|
||||
SetupConnectionType(
|
||||
&controller->window(),
|
||||
&controller->session().account(),
|
||||
content);
|
||||
AddSkip(content);
|
||||
SetupDataStorage(controller, content);
|
||||
SetupAutoDownload(controller, content);
|
||||
SetupSystemIntegration(controller, content, [=](Type type) {
|
||||
|
@ -779,6 +772,11 @@ void Advanced::setupContent(not_null<Window::SessionController*> controller) {
|
|||
addUpdate();
|
||||
}
|
||||
|
||||
AddSkip(content);
|
||||
AddDivider(content);
|
||||
AddSkip(content);
|
||||
SetupExport(controller, content);
|
||||
|
||||
Ui::ResizeFitChild(this, content);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "settings/settings_chat.h"
|
||||
|
||||
#include "settings/settings_common.h"
|
||||
#include "settings/settings_advanced.h"
|
||||
#include "boxes/connection_box.h"
|
||||
#include "boxes/auto_download_box.h"
|
||||
#include "boxes/stickers_box.h"
|
||||
|
@ -838,7 +839,8 @@ void SetupLocalStorage(
|
|||
AddButton(
|
||||
container,
|
||||
tr::lng_settings_manage_local_storage(),
|
||||
st::settingsButtonNoIcon
|
||||
st::settingsButton,
|
||||
{ &st::settingsIconGeneral, kIconLightOrange }
|
||||
)->addClickHandler([=] {
|
||||
LocalStorageBox::Show(&controller->session());
|
||||
});
|
||||
|
@ -854,21 +856,23 @@ void SetupDataStorage(
|
|||
|
||||
AddSubsectionTitle(container, tr::lng_settings_data_storage());
|
||||
|
||||
const auto ask = AddButton(
|
||||
container,
|
||||
tr::lng_download_path_ask(),
|
||||
st::settingsButtonNoIcon
|
||||
)->toggleOn(rpl::single(Core::App().settings().askDownloadPath()));
|
||||
SetupConnectionType(
|
||||
&controller->window(),
|
||||
&controller->session().account(),
|
||||
container);
|
||||
|
||||
#ifndef OS_WIN_STORE
|
||||
const auto showpath = Ui::CreateChild<rpl::event_stream<bool>>(ask);
|
||||
const auto showpath = container->lifetime(
|
||||
).make_state<rpl::event_stream<bool>>();
|
||||
|
||||
const auto path = container->add(
|
||||
object_ptr<Ui::SlideWrap<Button>>(
|
||||
container,
|
||||
CreateButton(
|
||||
container,
|
||||
tr::lng_download_path(),
|
||||
st::settingsButtonNoIcon)));
|
||||
st::settingsButton,
|
||||
{ &st::settingsIconFolders, kIconLightBlue })));
|
||||
auto pathtext = Core::App().settings().downloadPathValue(
|
||||
) | rpl::map([](const QString &text) {
|
||||
if (text.isEmpty()) {
|
||||
|
@ -881,14 +885,29 @@ void SetupDataStorage(
|
|||
CreateRightLabel(
|
||||
path->entity(),
|
||||
std::move(pathtext),
|
||||
st::settingsButtonNoIcon,
|
||||
st::settingsButton,
|
||||
tr::lng_download_path());
|
||||
path->entity()->addClickHandler([=] {
|
||||
controller->show(Box<DownloadPathBox>(controller));
|
||||
});
|
||||
path->toggleOn(ask->toggledValue() | rpl::map(!_1));
|
||||
#endif // OS_WIN_STORE
|
||||
|
||||
SetupLocalStorage(controller, container);
|
||||
|
||||
AddButton(
|
||||
container,
|
||||
rpl::single(u"Downloads"_q),
|
||||
st::settingsButton,
|
||||
{ &st::settingsIconDownload, kIconPurple }
|
||||
)->setClickedCallback([=] {
|
||||
});
|
||||
|
||||
const auto ask = AddButton(
|
||||
container,
|
||||
tr::lng_download_path_ask(),
|
||||
st::settingsButtonNoIcon
|
||||
)->toggleOn(rpl::single(Core::App().settings().askDownloadPath()));
|
||||
|
||||
ask->toggledValue(
|
||||
) | rpl::filter([](bool checked) {
|
||||
return (checked != Core::App().settings().askDownloadPath());
|
||||
|
@ -902,8 +921,9 @@ void SetupDataStorage(
|
|||
|
||||
}, ask->lifetime());
|
||||
|
||||
SetupLocalStorage(controller, container);
|
||||
SetupExport(controller, container);
|
||||
#ifndef OS_WIN_STORE
|
||||
path->toggleOn(ask->toggledValue() | rpl::map(!_1));
|
||||
#endif // OS_WIN_STORE
|
||||
|
||||
AddSkip(container, st::settingsCheckboxesSkip);
|
||||
}
|
||||
|
@ -917,19 +937,32 @@ void SetupAutoDownload(
|
|||
AddSubsectionTitle(container, tr::lng_media_auto_settings());
|
||||
|
||||
using Source = Data::AutoDownload::Source;
|
||||
const auto add = [&](rpl::producer<QString> label, Source source) {
|
||||
const auto add = [&](
|
||||
rpl::producer<QString> label,
|
||||
Source source,
|
||||
IconDescriptor &&descriptor) {
|
||||
AddButton(
|
||||
container,
|
||||
std::move(label),
|
||||
st::settingsButtonNoIcon
|
||||
st::settingsButton,
|
||||
std::move(descriptor)
|
||||
)->addClickHandler([=] {
|
||||
controller->show(
|
||||
Box<AutoDownloadBox>(&controller->session(), source));
|
||||
});
|
||||
};
|
||||
add(tr::lng_media_auto_in_private(), Source::User);
|
||||
add(tr::lng_media_auto_in_groups(), Source::Group);
|
||||
add(tr::lng_media_auto_in_channels(), Source::Channel);
|
||||
add(
|
||||
tr::lng_media_auto_in_private(),
|
||||
Source::User,
|
||||
{ &st::settingsIconUser, kIconLightBlue });
|
||||
add(
|
||||
tr::lng_media_auto_in_groups(),
|
||||
Source::Group,
|
||||
{ &st::settingsIconGroup, kIconGreen });
|
||||
add(
|
||||
tr::lng_media_auto_in_channels(),
|
||||
Source::Channel,
|
||||
{ &st::settingsIconChannel, kIconLightOrange });
|
||||
|
||||
AddSkip(container, st::settingsCheckboxesSkip);
|
||||
}
|
||||
|
|
|
@ -27,6 +27,9 @@ void SetupDefaultThemes(
|
|||
void SetupSupport(
|
||||
not_null<Window::SessionController*> controller,
|
||||
not_null<Ui::VerticalLayout*> container);
|
||||
void SetupExport(
|
||||
not_null<Window::SessionController*> controller,
|
||||
not_null<Ui::VerticalLayout*> container);
|
||||
|
||||
class Chat : public Section {
|
||||
public:
|
||||
|
|
|
@ -972,7 +972,7 @@ void MainMenu::setupMenu() {
|
|||
});
|
||||
addAction(
|
||||
tr::lng_menu_contacts(),
|
||||
{ &st::settingsIconContacts, kIconRed }
|
||||
{ &st::settingsIconUser, kIconRed }
|
||||
)->setClickedCallback([=] {
|
||||
controller->show(PrepareContactsBox(controller));
|
||||
});
|
||||
|
@ -993,7 +993,7 @@ void MainMenu::setupMenu() {
|
|||
} else {
|
||||
addAction(
|
||||
tr::lng_profile_add_contact(),
|
||||
{ &st::settingsIconContacts, kIconRed }
|
||||
{ &st::settingsIconUser, kIconRed }
|
||||
)->setClickedCallback([=] {
|
||||
controller->showAddContact();
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue