2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Option to hide folder names

This commit is contained in:
RadRussianRus
2020-03-30 09:38:52 +03:00
parent efe2dad856
commit d6eb5aedc2
7 changed files with 14 additions and 5 deletions

View File

@@ -346,6 +346,10 @@ bool Manager::readCustomFile() {
ReadBoolOption(o, "hide_edit_button", [&](auto v) {
cSetHideFilterEditButton(v);
});
ReadBoolOption(o, "hide_names", [&](auto v) {
cSetHideFilterNames(v);
});
});
return true;
}
@@ -396,6 +400,7 @@ void Manager::writeDefaultFile() {
settingsFolders.insert(qsl("default"), cDefaultFilterId());
settingsFolders.insert(qsl("count_unmuted_only"), cUnmutedFilterCounterOnly());
settingsFolders.insert(qsl("hide_edit_button"), cHideFilterEditButton());
settingsFolders.insert(qsl("hide_names"), cHideFilterNames());
settings.insert(qsl("folders"), settingsFolders);
@@ -468,6 +473,7 @@ void Manager::writeCurrentSettings() {
settingsFolders.insert(qsl("default"), cDefaultFilterId());
settingsFolders.insert(qsl("count_unmuted_only"), cUnmutedFilterCounterOnly());
settingsFolders.insert(qsl("hide_edit_button"), cHideFilterEditButton());
settingsFolders.insert(qsl("hide_names"), cHideFilterNames());
settings.insert(qsl("folders"), settingsFolders);

View File

@@ -323,3 +323,4 @@ int gCustomAppIcon = 0;
int gDefaultFilterId = 0;
bool gUnmutedFilterCounterOnly = false;
bool gHideFilterEditButton = false;
bool gHideFilterNames = false;

View File

@@ -253,3 +253,4 @@ DeclareSetting(int, CustomAppIcon);
DeclareSetting(int, DefaultFilterId);
DeclareSetting(bool, UnmutedFilterCounterOnly);
DeclareSetting(bool, HideFilterEditButton);
DeclareSetting(bool, HideFilterNames);

View File

@@ -251,10 +251,11 @@ createThemeLink: InputField(defaultInputField) {
}
windowFiltersWidth: 72px;
windowFiltersWidthNoText: 50px;
windowFiltersButton: SideBarButton(defaultSideBarButton) {
textTop: 40px;
textSkip: 6px;
minHeight: 62px;
minHeight: 48px;
minTextWidth: 48px;
style: TextStyle(defaultTextStyle) {
font: font(11px semibold);

View File

@@ -89,7 +89,7 @@ void FiltersMenu::setup() {
_parent->heightValue(
) | rpl::start_with_next([=](int height) {
const auto width = st::windowFiltersWidth;
const auto width = (cHideFilterNames() ? st::windowFiltersWidthNoText : st::windowFiltersWidth);
_outer.setGeometry({ 0, 0, width, height });
_menu.resizeToWidth(width);
_menu.move(0, 0);
@@ -203,7 +203,7 @@ base::unique_qptr<Ui::SideBarButton> FiltersMenu::prepareButton(
auto button = base::unique_qptr<Ui::SideBarButton>(container->add(
object_ptr<Ui::SideBarButton>(
container,
title,
(cHideFilterNames() ? QString() : title),
st::windowFiltersButton)));
const auto raw = button.get();
const auto &icons = Ui::LookupFilterIcon(icon);

View File

@@ -775,7 +775,7 @@ rpl::producer<FullMsgId> SessionController::floatPlayerClosed() const {
}
int SessionController::filtersWidth() const {
return _filters ? st::windowFiltersWidth : 0;
return _filters ? (cHideFilterNames() ? st::windowFiltersWidthNoText : st::windowFiltersWidth) : 0;
}
rpl::producer<FilterId> SessionController::activeChatsFilter() const {