Skip to content

Commit 54fd5d8

Browse files
seperate gap values for float
1 parent ae1fea2 commit 54fd5d8

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

src/config/ConfigDescriptions.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = {
3232
.type = CONFIG_OPTION_STRING_SHORT,
3333
.data = SConfigOptionDescription::SStringData{"20"},
3434
},
35+
SConfigOptionDescription{
36+
.value = "general:float_gaps_in",
37+
.description = "gaps between windows for floating windows\n\nsupports css style gaps (top, right, bottom, left -> 5 10 15 20)",
38+
.type = CONFIG_OPTION_STRING_SHORT,
39+
.data = SConfigOptionDescription::SStringData{"5"},
40+
},
41+
SConfigOptionDescription{
42+
.value = "general:float_gaps_out",
43+
.description = "gaps between windows and monitor edges for floating windows\n\nsupports css style gaps (top, right, bottom, left -> 5 10 15 20)",
44+
.type = CONFIG_OPTION_STRING_SHORT,
45+
.data = SConfigOptionDescription::SStringData{"20"},
46+
},
3547
SConfigOptionDescription{
3648
.value = "general:gaps_workspaces",
3749
.description = "gaps between workspaces. Stacks with gaps_out.",

src/config/ConfigManager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ CConfigManager::CConfigManager() {
384384
m_pConfig->addConfigValue("general:border_part_of_window", Hyprlang::INT{1});
385385
m_pConfig->addConfigValue("general:gaps_in", Hyprlang::CConfigCustomValueType{configHandleGapSet, configHandleGapDestroy, "5"});
386386
m_pConfig->addConfigValue("general:gaps_out", Hyprlang::CConfigCustomValueType{configHandleGapSet, configHandleGapDestroy, "20"});
387+
m_pConfig->addConfigValue("general:float_gaps_in", Hyprlang::CConfigCustomValueType{configHandleGapSet, configHandleGapDestroy, "5"});
388+
m_pConfig->addConfigValue("general:float_gaps_out", Hyprlang::CConfigCustomValueType{configHandleGapSet, configHandleGapDestroy, "20"});
387389
m_pConfig->addConfigValue("general:gaps_workspaces", Hyprlang::INT{0});
388390
m_pConfig->addConfigValue("general:no_focus_fallback", Hyprlang::INT{0});
389391
m_pConfig->addConfigValue("general:resize_on_border", Hyprlang::INT{0});

src/config/ConfigManager.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ struct SWorkspaceRule {
3636
bool isPersistent = false;
3737
std::optional<CCssGapData> gapsIn;
3838
std::optional<CCssGapData> gapsOut;
39+
std::optional<CCssGapData> float_gapsIn = gapsIn;
40+
std::optional<CCssGapData> float_gapsOut = gapsOut;
3941
std::optional<int64_t> borderSize;
4042
std::optional<bool> decorate;
4143
std::optional<bool> noRounding;

src/managers/KeybindManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,7 @@ SDispatchResult CKeybindManager::moveActiveTo(std::string args) {
16381638
std::optional<float> vPosx, vPosy;
16391639
const auto PMONITOR = PLASTWINDOW->m_pMonitor.lock();
16401640
const auto BORDERSIZE = PLASTWINDOW->getRealBorderSize();
1641-
static auto PGAPSOUTDATA = CConfigValue<Hyprlang::CUSTOMTYPE>("general:gaps_out");
1641+
static auto PGAPSOUTDATA = CConfigValue<Hyprlang::CUSTOMTYPE>("general:float_gaps_out");
16421642
auto* const PGAPSOUT = (CCssGapData*)(PGAPSOUTDATA.ptr())->getData();
16431643

16441644
switch (arg) {

0 commit comments

Comments
 (0)