mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-02 07:35:12 +00:00
[Improvement] Settings three-dots menu improvements
This commit is contained in:
committed by
Eric Kotato
parent
bb09cc9387
commit
727b35b961
@@ -28,6 +28,8 @@
|
|||||||
"ktg_mac_menu_show": "Show Kotatogram",
|
"ktg_mac_menu_show": "Show Kotatogram",
|
||||||
"ktg_settings_kotato": "Kotatogram Settings",
|
"ktg_settings_kotato": "Kotatogram Settings",
|
||||||
"ktg_user_status_unaccessible": "account inaccessible",
|
"ktg_user_status_unaccessible": "account inaccessible",
|
||||||
|
"ktg_settings_show_json_settings": "Show settings file",
|
||||||
|
"ktg_settings_restart": "Restart Kotatogram",
|
||||||
"ktg_settings_chats": "Chats",
|
"ktg_settings_chats": "Chats",
|
||||||
"ktg_settings_sticker_height": "Sticker height: {pixels}px",
|
"ktg_settings_sticker_height": "Sticker height: {pixels}px",
|
||||||
"ktg_settings_sticker_scale_both": "Apply to sticker width",
|
"ktg_settings_sticker_scale_both": "Apply to sticker width",
|
||||||
|
@@ -33,6 +33,7 @@ https://github.com/kotatogram/kotatogram-desktop/blob/dev/LEGAL
|
|||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "core/update_checker.h"
|
#include "core/update_checker.h"
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
|
#include "core/file_utilities.h"
|
||||||
#include "storage/localstorage.h"
|
#include "storage/localstorage.h"
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "data/data_cloud_themes.h"
|
#include "data/data_cloud_themes.h"
|
||||||
@@ -43,6 +44,7 @@ https://github.com/kotatogram/kotatogram-desktop/blob/dev/LEGAL
|
|||||||
#include "styles/style_settings.h"
|
#include "styles/style_settings.h"
|
||||||
#include "ui/platform/ui_platform_utility.h"
|
#include "ui/platform/ui_platform_utility.h"
|
||||||
#include "ui/vertical_list.h"
|
#include "ui/vertical_list.h"
|
||||||
|
#include "styles/style_menu_icons.h"
|
||||||
|
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
|
|
||||||
@@ -590,6 +592,19 @@ void SetupKotatoOther(
|
|||||||
Ui::AddSkip(container);
|
Ui::AddSkip(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void KotatoTopBarOptions(const Ui::Menu::MenuCallback &addAction) {
|
||||||
|
const auto customSettingsFile = cWorkingDir() + "tdata/kotato-settings-custom.json";
|
||||||
|
|
||||||
|
addAction(
|
||||||
|
ktr("ktg_settings_show_json_settings"),
|
||||||
|
[=] { File::ShowInFolder(customSettingsFile); },
|
||||||
|
&st::menuIconSettings);
|
||||||
|
addAction(
|
||||||
|
ktr("ktg_settings_restart"),
|
||||||
|
[] { Core::Restart(); },
|
||||||
|
&st::menuIconRestore);
|
||||||
|
}
|
||||||
|
|
||||||
Kotato::Kotato(
|
Kotato::Kotato(
|
||||||
QWidget *parent,
|
QWidget *parent,
|
||||||
not_null<Window::SessionController*> controller)
|
not_null<Window::SessionController*> controller)
|
||||||
@@ -603,7 +618,7 @@ rpl::producer<QString> Kotato::title() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Kotato::fillTopBarMenu(const Ui::Menu::MenuCallback &addAction) {
|
void Kotato::fillTopBarMenu(const Ui::Menu::MenuCallback &addAction) {
|
||||||
const auto window = &_controller->window();
|
KotatoTopBarOptions(addAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kotato::setupContent(not_null<Window::SessionController*> controller) {
|
void Kotato::setupContent(not_null<Window::SessionController*> controller) {
|
||||||
|
@@ -23,6 +23,8 @@ void SetupKotatoSystem(
|
|||||||
not_null<Ui::VerticalLayout*> container);
|
not_null<Ui::VerticalLayout*> container);
|
||||||
void SetupKotatoOther(not_null<Ui::VerticalLayout*> container);
|
void SetupKotatoOther(not_null<Ui::VerticalLayout*> container);
|
||||||
|
|
||||||
|
void KotatoTopBarOptions(const Ui::Menu::MenuCallback &addAction);
|
||||||
|
|
||||||
class Kotato : public Section<Kotato> {
|
class Kotato : public Section<Kotato> {
|
||||||
public:
|
public:
|
||||||
Kotato(
|
Kotato(
|
||||||
|
@@ -697,6 +697,7 @@ void Main::fillTopBarMenu(const Ui::Menu::MenuCallback &addAction) {
|
|||||||
[=] { showOther(Information::Id()); },
|
[=] { showOther(Information::Id()); },
|
||||||
&st::menuIconInfo);
|
&st::menuIconInfo);
|
||||||
}
|
}
|
||||||
|
KotatoTopBarOptions(addAction);
|
||||||
const auto window = &_controller->window();
|
const auto window = &_controller->window();
|
||||||
addAction({
|
addAction({
|
||||||
.text = tr::lng_settings_logout(tr::now),
|
.text = tr::lng_settings_logout(tr::now),
|
||||||
|
Reference in New Issue
Block a user