hypr-chrome v0.1

This commit is contained in:
2026-07-28 21:22:13 +02:00
commit a28a899874
18 changed files with 1227 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
#pragma once
#include "Common.hpp"
#include "ChromeConfig.hpp"
#include <vector>
class ChromeDecoration;
struct GlobalState {
ChromeConfig config;
std::vector<WP<ChromeDecoration>> decorations;
GlobalState(HANDLE plugin) {
config = ChromeConfig{
.enabled = makeShared<BoolValue>(
"plugin:hyprchrome:enabled",
"Whether the border decoration is enabled",
true),
.extent = makeShared<IntValue>(
"plugin:hyprchrome:extent",
"How far the border extends past each window edge, in pixels",
12),
.followHyprlandBorderColor = makeShared<BoolValue>(
"plugin:hyprchrome:follow_hyprland_border_color",
"Whether the border tracks Hyprland's own active/inactive border color instead of active_color/inactive_color",
true),
.activeColor = makeShared<ColorValue>(
"plugin:hyprchrome:active_color",
"Color of the border on the focused window, used when follow_hyprland_border_color is false",
RGBAToARGB(0xFFD063FF)),
.inactiveColor = makeShared<ColorValue>(
"plugin:hyprchrome:inactive_color",
"Color of the border on unfocused windows, used when follow_hyprland_border_color is false",
RGBAToARGB(0x6C6C6CFF)),
.titlebarHeight = makeShared<IntValue>(
"plugin:hyprchrome:titlebar_height",
"Height of the title bar hanging off the floating top-border cutout, in pixels",
8),
.titlebarTextSize = makeShared<IntValue>(
"plugin:hyprchrome:titlebar_text_size",
"Font size of the title bar's text, in pixels",
12),
.titlebarFont = makeShared<StringValue>(
"plugin:hyprchrome:titlebar_font",
"Font family of the title bar's text",
"sans-serif"),
};
HyprlandAPI::addConfigValueV2(plugin, config.enabled);
HyprlandAPI::addConfigValueV2(plugin, config.extent);
HyprlandAPI::addConfigValueV2(plugin, config.followHyprlandBorderColor);
HyprlandAPI::addConfigValueV2(plugin, config.activeColor);
HyprlandAPI::addConfigValueV2(plugin, config.inactiveColor);
HyprlandAPI::addConfigValueV2(plugin, config.titlebarHeight);
HyprlandAPI::addConfigValueV2(plugin, config.titlebarTextSize);
HyprlandAPI::addConfigValueV2(plugin, config.titlebarFont);
}
};