diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp index 7f70d69..b93c181 100644 --- a/src/Hy3Layout.cpp +++ b/src/Hy3Layout.cpp @@ -121,8 +121,9 @@ void Hy3Node::recalcSizePosRecursive(bool force) { auto tpos = this->position + Vector2D(outer_gaps, outer_gaps); auto tsize = this->size - Vector2D(outer_gaps * 2, outer_gaps * 2); - static const auto* tab_bar_height = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:bar_height")->intValue; - double tab_height_offset = *gaps_in + *tab_bar_height; + static const auto* tab_bar_height = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:height")->intValue; + static const auto* tab_bar_padding = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:padding")->intValue; + double tab_height_offset = *tab_bar_height + *tab_bar_padding; if (this->data.type != Hy3NodeData::Group) { this->data.as_window->setHidden(this->hidden); diff --git a/src/TabGroup.cpp b/src/TabGroup.cpp index 6d24aa9..7101a32 100644 --- a/src/TabGroup.cpp +++ b/src/TabGroup.cpp @@ -4,6 +4,8 @@ #include #include +#include +#include #include #include @@ -47,6 +49,8 @@ void Hy3TabBarEntry::setUrgent(bool urgent) { void Hy3TabBarEntry::prepareTexture(float scale, wlr_box& box) { static const auto* rounding_setting = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:rounding")->intValue; + static const auto* col_active = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:col.active")->intValue; + static const auto* col_inactive = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:col.inactive")->intValue; auto width = box.width; auto height = box.height; @@ -75,9 +79,11 @@ void Hy3TabBarEntry::prepareTexture(float scale, wlr_box& box) { // set brush if (this->focused) { - cairo_set_source_rgba(cairo, 0.2, 0.7, 1.0, 1.0); + auto c = CColor(*col_active); + cairo_set_source_rgba(cairo, c.r, c.g, c.b, c.a); } else { - cairo_set_source_rgba(cairo, 0.5, 0.5, 0.5, 1.0); + auto c = CColor(*col_inactive); + cairo_set_source_rgba(cairo, c.r, c.g, c.b, c.a); } // outline bar shape @@ -266,7 +272,7 @@ void Hy3TabGroup::updateWithGroup(Hy3Node& node) { Debug::log(LOG, "updated tab bar for %p", &node); static const auto* gaps_in = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_in")->intValue; static const auto* gaps_out = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_out")->intValue; - static const auto* bar_height = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:bar_height")->intValue; + static const auto* bar_height = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:height")->intValue; auto gaps = node.parent == nullptr ? *gaps_out : *gaps_in; auto tpos = node.position + Vector2D(gaps, gaps); diff --git a/src/main.cpp b/src/main.cpp index 3ffa2dc..8f5ab43 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -106,7 +106,10 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) { selection_hook::init(); HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:no_gaps_when_only", SConfigValue{.intValue = 0}); - HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:bar_height", SConfigValue{.intValue = 15}); + HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:height", SConfigValue{.intValue = 15}); + HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:padding", SConfigValue{.intValue = 5}); + HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:col.active", SConfigValue{.intValue = 0xff32b4ff}); + HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:col.inactive", SConfigValue{.intValue = 0x80808080}); HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:from_top", SConfigValue{.intValue = 0}); HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:rounding", SConfigValue{.intValue = 3});