mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-29 02:43:48 -07:00
renderer: Add rounding power setting to groupbar and gradient roundness. (#11420)
This commit is contained in:
@@ -1013,12 +1013,24 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = {
|
|||||||
.type = CONFIG_OPTION_INT,
|
.type = CONFIG_OPTION_INT,
|
||||||
.data = SConfigOptionDescription::SRangeData{1, 0, 20},
|
.data = SConfigOptionDescription::SRangeData{1, 0, 20},
|
||||||
},
|
},
|
||||||
|
SConfigOptionDescription{
|
||||||
|
.value = "group:groupbar:rounding_power",
|
||||||
|
.description = "rounding power of groupbar corners (2 is a circle)",
|
||||||
|
.type = CONFIG_OPTION_FLOAT,
|
||||||
|
.data = SConfigOptionDescription::SFloatData{2, 2, 10},
|
||||||
|
},
|
||||||
SConfigOptionDescription{
|
SConfigOptionDescription{
|
||||||
.value = "group:groupbar:gradient_rounding",
|
.value = "group:groupbar:gradient_rounding",
|
||||||
.description = "how much to round the groupbar gradient",
|
.description = "how much to round the groupbar gradient",
|
||||||
.type = CONFIG_OPTION_INT,
|
.type = CONFIG_OPTION_INT,
|
||||||
.data = SConfigOptionDescription::SRangeData{1, 0, 20},
|
.data = SConfigOptionDescription::SRangeData{1, 0, 20},
|
||||||
},
|
},
|
||||||
|
SConfigOptionDescription{
|
||||||
|
.value = "group:groupbar:gradient_rounding_power",
|
||||||
|
.description = "rounding power of groupbar gradient corners (2 is a circle)",
|
||||||
|
.type = CONFIG_OPTION_FLOAT,
|
||||||
|
.data = SConfigOptionDescription::SFloatData{2, 2, 10},
|
||||||
|
},
|
||||||
SConfigOptionDescription{
|
SConfigOptionDescription{
|
||||||
.value = "group:groupbar:round_only_edges",
|
.value = "group:groupbar:round_only_edges",
|
||||||
.description = "if yes, will only round at the groupbar edges",
|
.description = "if yes, will only round at the groupbar edges",
|
||||||
|
@@ -525,7 +525,9 @@ CConfigManager::CConfigManager() {
|
|||||||
registerConfigVar("group:groupbar:text_color_locked_inactive", Hyprlang::INT{-1});
|
registerConfigVar("group:groupbar:text_color_locked_inactive", Hyprlang::INT{-1});
|
||||||
registerConfigVar("group:groupbar:stacked", Hyprlang::INT{0});
|
registerConfigVar("group:groupbar:stacked", Hyprlang::INT{0});
|
||||||
registerConfigVar("group:groupbar:rounding", Hyprlang::INT{1});
|
registerConfigVar("group:groupbar:rounding", Hyprlang::INT{1});
|
||||||
|
registerConfigVar("group:groupbar:rounding_power", {2.F});
|
||||||
registerConfigVar("group:groupbar:gradient_rounding", Hyprlang::INT{2});
|
registerConfigVar("group:groupbar:gradient_rounding", Hyprlang::INT{2});
|
||||||
|
registerConfigVar("group:groupbar:gradient_rounding_power", {2.F});
|
||||||
registerConfigVar("group:groupbar:round_only_edges", Hyprlang::INT{1});
|
registerConfigVar("group:groupbar:round_only_edges", Hyprlang::INT{1});
|
||||||
registerConfigVar("group:groupbar:gradient_round_only_edges", Hyprlang::INT{1});
|
registerConfigVar("group:groupbar:gradient_round_only_edges", Hyprlang::INT{1});
|
||||||
registerConfigVar("group:groupbar:gaps_out", Hyprlang::INT{2});
|
registerConfigVar("group:groupbar:gaps_out", Hyprlang::INT{2});
|
||||||
|
@@ -113,7 +113,9 @@ void CHyprGroupBarDecoration::draw(PHLMONITOR pMonitor, float const& a) {
|
|||||||
static auto PGRADIENTS = CConfigValue<Hyprlang::INT>("group:groupbar:gradients");
|
static auto PGRADIENTS = CConfigValue<Hyprlang::INT>("group:groupbar:gradients");
|
||||||
static auto PSTACKED = CConfigValue<Hyprlang::INT>("group:groupbar:stacked");
|
static auto PSTACKED = CConfigValue<Hyprlang::INT>("group:groupbar:stacked");
|
||||||
static auto PROUNDING = CConfigValue<Hyprlang::INT>("group:groupbar:rounding");
|
static auto PROUNDING = CConfigValue<Hyprlang::INT>("group:groupbar:rounding");
|
||||||
|
static auto PROUNDINGPOWER = CConfigValue<Hyprlang::FLOAT>("group:groupbar:rounding_power");
|
||||||
static auto PGRADIENTROUNDING = CConfigValue<Hyprlang::INT>("group:groupbar:gradient_rounding");
|
static auto PGRADIENTROUNDING = CConfigValue<Hyprlang::INT>("group:groupbar:gradient_rounding");
|
||||||
|
static auto PGRADIENTROUNDINGPOWER = CConfigValue<Hyprlang::FLOAT>("group:groupbar:gradient_rounding_power");
|
||||||
static auto PGRADIENTROUNDINGONLYEDGES = CConfigValue<Hyprlang::INT>("group:groupbar:gradient_round_only_edges");
|
static auto PGRADIENTROUNDINGONLYEDGES = CConfigValue<Hyprlang::INT>("group:groupbar:gradient_round_only_edges");
|
||||||
static auto PROUNDONLYEDGES = CConfigValue<Hyprlang::INT>("group:groupbar:round_only_edges");
|
static auto PROUNDONLYEDGES = CConfigValue<Hyprlang::INT>("group:groupbar:round_only_edges");
|
||||||
static auto PGROUPCOLACTIVE = CConfigValue<Hyprlang::CUSTOMTYPE>("group:groupbar:col.active");
|
static auto PGROUPCOLACTIVE = CConfigValue<Hyprlang::CUSTOMTYPE>("group:groupbar:col.active");
|
||||||
@@ -163,6 +165,7 @@ void CHyprGroupBarDecoration::draw(PHLMONITOR pMonitor, float const& a) {
|
|||||||
rectdata.color = color;
|
rectdata.color = color;
|
||||||
rectdata.box = rect;
|
rectdata.box = rect;
|
||||||
if (*PROUNDING) {
|
if (*PROUNDING) {
|
||||||
|
rectdata.roundingPower = *PROUNDINGPOWER;
|
||||||
if (*PROUNDONLYEDGES) {
|
if (*PROUNDONLYEDGES) {
|
||||||
static constexpr double PADDING = 20;
|
static constexpr double PADDING = 20;
|
||||||
|
|
||||||
@@ -203,6 +206,7 @@ void CHyprGroupBarDecoration::draw(PHLMONITOR pMonitor, float const& a) {
|
|||||||
data.tex = GRADIENTTEX;
|
data.tex = GRADIENTTEX;
|
||||||
data.box = rect;
|
data.box = rect;
|
||||||
if (*PGRADIENTROUNDING) {
|
if (*PGRADIENTROUNDING) {
|
||||||
|
data.roundingPower = *PGRADIENTROUNDINGPOWER;
|
||||||
if (*PGRADIENTROUNDINGONLYEDGES) {
|
if (*PGRADIENTROUNDINGONLYEDGES) {
|
||||||
static constexpr double PADDING = 20;
|
static constexpr double PADDING = 20;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user