mirror of https://github.com/procxx/kepka.git
Move main menu button to the side bar.
This commit is contained in:
parent
f8cc134bd6
commit
48d790de5e
|
@ -259,6 +259,7 @@ Widget::Widget(
|
||||||
Core::App().lockByPasscode();
|
Core::App().lockByPasscode();
|
||||||
_lockUnlock->setIconOverride(nullptr);
|
_lockUnlock->setIconOverride(nullptr);
|
||||||
});
|
});
|
||||||
|
_mainMenuToggle->setVisible(!controller->filtersWidth());
|
||||||
_mainMenuToggle->setClickedCallback([this] { showMainMenu(); });
|
_mainMenuToggle->setClickedCallback([this] { showMainMenu(); });
|
||||||
|
|
||||||
_chooseByDragTimer.setSingleShot(true);
|
_chooseByDragTimer.setSingleShot(true);
|
||||||
|
@ -1500,7 +1501,7 @@ void Widget::updateControlsGeometry() {
|
||||||
}
|
}
|
||||||
auto smallLayoutWidth = (st::dialogsPadding.x() + st::dialogsPhotoSize + st::dialogsPadding.x());
|
auto smallLayoutWidth = (st::dialogsPadding.x() + st::dialogsPhotoSize + st::dialogsPadding.x());
|
||||||
auto smallLayoutRatio = (width() < st::columnMinimalWidthLeft) ? (st::columnMinimalWidthLeft - width()) / float64(st::columnMinimalWidthLeft - smallLayoutWidth) : 0.;
|
auto smallLayoutRatio = (width() < st::columnMinimalWidthLeft) ? (st::columnMinimalWidthLeft - width()) / float64(st::columnMinimalWidthLeft - smallLayoutWidth) : 0.;
|
||||||
auto filterLeft = st::dialogsFilterPadding.x() + _mainMenuToggle->width() + st::dialogsFilterPadding.x();
|
auto filterLeft = (controller()->filtersWidth() ? 0 : st::dialogsFilterPadding.x() + _mainMenuToggle->width()) + st::dialogsFilterPadding.x();
|
||||||
auto filterRight = (Global::LocalPasscode() ? (st::dialogsFilterPadding.x() + _lockUnlock->width()) : st::dialogsFilterSkip) + st::dialogsFilterPadding.x();
|
auto filterRight = (Global::LocalPasscode() ? (st::dialogsFilterPadding.x() + _lockUnlock->width()) : st::dialogsFilterSkip) + st::dialogsFilterPadding.x();
|
||||||
auto filterWidth = qMax(width(), st::columnMinimalWidthLeft) - filterLeft - filterRight;
|
auto filterWidth = qMax(width(), st::columnMinimalWidthLeft) - filterLeft - filterRight;
|
||||||
auto filterAreaHeight = st::topBarHeight;
|
auto filterAreaHeight = st::topBarHeight;
|
||||||
|
|
|
@ -246,6 +246,8 @@ createThemeLink: InputField(defaultInputField) {
|
||||||
}
|
}
|
||||||
|
|
||||||
windowFiltersWidth: 72px;
|
windowFiltersWidth: 72px;
|
||||||
|
windowFiltersMainMenu: icon {{ "dialogs_menu", sideBarIconFg }};
|
||||||
|
windowFiltersMainMenuIconTop: 12px;
|
||||||
windowFiltersIconTop: 8px;
|
windowFiltersIconTop: 8px;
|
||||||
windowFiltersAll: icon {{ "filters_all", sideBarIconFg }};
|
windowFiltersAll: icon {{ "filters_all", sideBarIconFg }};
|
||||||
windowFiltersAllActive: icon {{ "filters_all_active", sideBarIconFgActive }};
|
windowFiltersAllActive: icon {{ "filters_all_active", sideBarIconFgActive }};
|
||||||
|
|
|
@ -48,7 +48,9 @@ void FiltersMenu::setup() {
|
||||||
|
|
||||||
_widget.activateRequests(
|
_widget.activateRequests(
|
||||||
) | rpl::start_with_next([=](const QString &id) {
|
) | rpl::start_with_next([=](const QString &id) {
|
||||||
if (id == "setup") {
|
if (id == "main_menu") {
|
||||||
|
_session->widget()->showMainMenu();
|
||||||
|
} else if (id == "setup") {
|
||||||
} else if (const auto filterId = id.toInt()) {
|
} else if (const auto filterId = id.toInt()) {
|
||||||
_session->setActiveChatsFilter(filterId);
|
_session->setActiveChatsFilter(filterId);
|
||||||
} else {
|
} else {
|
||||||
|
@ -59,6 +61,14 @@ void FiltersMenu::setup() {
|
||||||
|
|
||||||
void FiltersMenu::refresh() {
|
void FiltersMenu::refresh() {
|
||||||
auto items = std::vector<Ui::SideBarMenu::Item>();
|
auto items = std::vector<Ui::SideBarMenu::Item>();
|
||||||
|
items.push_back({
|
||||||
|
"main_menu",
|
||||||
|
QString(),
|
||||||
|
QString(),
|
||||||
|
&st::windowFiltersMainMenu,
|
||||||
|
&st::windowFiltersMainMenu,
|
||||||
|
st::windowFiltersMainMenuIconTop
|
||||||
|
});
|
||||||
items.push_back({
|
items.push_back({
|
||||||
QString::number(0),
|
QString::number(0),
|
||||||
"All Chats",
|
"All Chats",
|
||||||
|
|
Loading…
Reference in New Issue