Skip to content

Commit b4e9801

Browse files
committed
ui: add configurable window size
1 parent 53a6b3f commit b4e9801

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/config/ConfigManager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ CConfigManager::CConfigManager() : m_inotifyFd(inotify_init()) {
2424
m_config->addConfigValue("finders:desktop_launch_prefix", Hyprlang::STRING{""});
2525
m_config->addConfigValue("finders:desktop_icons", Hyprlang::INT{1});
2626

27+
m_config->addConfigValue("ui:window_size", Hyprlang::VEC2{400, 260});
28+
2729
m_config->commence();
2830

2931
replantWatch();

src/ui/UI.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ using namespace Hyprutils::String;
1717
constexpr const size_t MAX_RESULTS_IN_LAUNCHER = 25;
1818

1919
CUI::CUI(bool open) : m_openByDefault(open) {
20-
static auto PGRABFOCUS = Hyprlang::CSimpleConfigValue<Hyprlang::INT>(g_configManager->m_config.get(), "general:grab_focus");
20+
static auto PGRABFOCUS = Hyprlang::CSimpleConfigValue<Hyprlang::INT>(g_configManager->m_config.get(), "general:grab_focus");
21+
static auto PWINDOWSIZE = Hyprlang::CSimpleConfigValue<Hyprlang::VEC2>(g_configManager->m_config.get(), "ui:window_size");
2122

2223
m_backend = Hyprtoolkit::IBackend::create();
2324

@@ -68,7 +69,7 @@ CUI::CUI(bool open) : m_openByDefault(open) {
6869
m_window = Hyprtoolkit::CWindowBuilder::begin()
6970
->appClass("hyprlauncher")
7071
->type(Hyprtoolkit::HT_WINDOW_LAYER)
71-
->preferredSize({400, 260})
72+
->preferredSize({(*PWINDOWSIZE).x, (*PWINDOWSIZE).y})
7273
->anchor(1 | 2 | 4 | 8)
7374
->exclusiveZone(-1)
7475
->layer(3)

0 commit comments

Comments
 (0)