feat: system settings stored as applets in virtual folder
This commit is contained in:
1 parent
de96c1ca57
commit
be67fce29a
21 files changed
+747
-359
No files matched your search
@@ -10,24 +10,17 @@
|
||||
#include "../../wallpaper.hpp"
|
||||
#include <gui/mtk.hpp>
|
||||
#include <montauk/config.h>
|
||||
#include <montauk/user.h>
|
||||
|
||||
namespace settings_app {
|
||||
|
||||
struct SettingsState {
|
||||
DesktopState* desktop;
|
||||
int active_tab; // 0=Appearance, 1=Display, 2=Users, 3=About
|
||||
int active_tab; // 0=Appearance, 1=Display, 2=About
|
||||
Montauk::SysInfo sys_info;
|
||||
uint64_t uptime_ms;
|
||||
WallpaperFileList wp_files;
|
||||
bool wp_scanned;
|
||||
|
||||
// Users tab
|
||||
montauk::user::UserInfo users[16];
|
||||
int user_count;
|
||||
int selected_user; // index into users[], or -1
|
||||
bool users_loaded;
|
||||
|
||||
char status_msg[128];
|
||||
uint64_t status_time;
|
||||
};
|
||||
@@ -73,13 +66,10 @@ inline const Color accent_palette[SWATCH_COUNT] = {
|
||||
};
|
||||
|
||||
inline constexpr int TAB_BAR_H = 36;
|
||||
inline constexpr int TAB_COUNT = 4;
|
||||
inline constexpr const char* tab_labels[TAB_COUNT] = { "Appearance", "Display", "Users", "About" };
|
||||
inline constexpr int TAB_COUNT = 3;
|
||||
inline constexpr const char* tab_labels[TAB_COUNT] = { "Appearance", "Display", "About" };
|
||||
|
||||
inline constexpr int WP_ITEM_H = 24;
|
||||
inline constexpr int USER_BTN_H = 30;
|
||||
inline constexpr int USER_BTN_W = 100;
|
||||
inline constexpr int USER_FIELD_H = 32;
|
||||
|
||||
inline mtk::Theme settings_theme(const SettingsState* st) {
|
||||
return mtk::make_theme(st->desktop->settings.accent_color);
|
||||
@@ -98,19 +88,9 @@ bool settings_handle_appearance_click(Window* win, SettingsState* st, int mx, in
|
||||
void settings_draw_display(Canvas& c, SettingsState* st);
|
||||
bool settings_handle_display_click(SettingsState* st, int mx, int cy);
|
||||
|
||||
void settings_draw_users(Canvas& c, SettingsState* st);
|
||||
bool settings_handle_users_click(Window* win, SettingsState* st, int mx, int cy);
|
||||
|
||||
void settings_draw_about(Canvas& c, SettingsState* st);
|
||||
|
||||
void settings_persist(SettingsState* st);
|
||||
void settings_persist_tz(SettingsState* st);
|
||||
|
||||
void users_reload(SettingsState* st);
|
||||
int user_row_height();
|
||||
|
||||
void open_add_user_dialog(SettingsState* parent);
|
||||
void open_change_pwd_dialog(SettingsState* parent);
|
||||
void open_delete_user_dialog(SettingsState* parent);
|
||||
|
||||
} // namespace settings_app
|
||||
Reference in new issue
Block a user