2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-03 08:05:12 +00:00

Update icons in settings / manage layers.

This commit is contained in:
John Preston
2023-08-14 14:04:33 +02:00
parent 59546e87dc
commit cc27b6c5c5
109 changed files with 184 additions and 268 deletions

View File

@@ -47,38 +47,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <QAction>
namespace Settings {
namespace {
base::options::toggle OptionMonoSettingsIcons({
.id = kOptionMonoSettingsIcons,
.name = "Mono settings and menu icons",
.description = "Use a single color for settings and main menu icons.",
});
} // namespace
const char kOptionMonoSettingsIcons[] = "mono-settings-icons";
Icon::Icon(IconDescriptor descriptor) : _icon(descriptor.icon) {
const auto background = [&]() -> const style::color* {
if (descriptor.type == IconType::Simple) {
return nullptr;
} else if (OptionMonoSettingsIcons.value()) {
return &st::transparent;
} else if (descriptor.color > 0) {
const auto list = std::array{
&st::settingsIconBg1,
&st::settingsIconBg2,
&st::settingsIconBg3,
&st::settingsIconBg4,
&st::settingsIconBg5,
&st::settingsIconBg6,
(const style::color*)nullptr,
&st::settingsIconBg8,
&st::settingsIconBgArchive,
};
Assert(descriptor.color < 10 && descriptor.color != 7);
return list[descriptor.color - 1];
}
return descriptor.background;
}();
@@ -111,11 +84,7 @@ void Icon::paint(QPainter &p, int x, int y) const {
_backgroundBrush->first,
_backgroundBrush->first);
}
if (OptionMonoSettingsIcons.value()) {
_icon->paint(p, { x, y }, 2 * x + _icon->width(), st::menuIconFg->c);
} else {
_icon->paint(p, { x, y }, 2 * x + _icon->width());
}
_icon->paint(p, { x, y }, 2 * x + _icon->width());
}
int Icon::width() const {