deine mum

This commit is contained in:
2025-12-12 23:11:55 +01:00
parent e1eeb370da
commit f1c68321a7
7 changed files with 42 additions and 25 deletions

5
.clangd Normal file
View File

@@ -0,0 +1,5 @@
CompileFlags:
Remove:
- -fmodules-ts
- -fmodule-mapper=*
- -fdeps-format=*

View File

@@ -10,6 +10,7 @@
#include "widgets/tray.hpp"
#include "widgets/webWidget.hpp"
#include "widgets/workspaceIndicator.hpp"
#include "icons.hpp"
class Bar : public Gtk::Window {
public:
@@ -25,7 +26,7 @@ class Bar : public Gtk::Window {
private:
Clock clock;
Date date;
WebWidget homeAssistant {"HA", "Home Assistant",
WebWidget homeAssistant {ICON_HOME, "Home Assistant",
"https://home.rivercry.com"};
TrayService &trayService;
HyprlandService &hyprlandService;

3
include/icons.hpp Normal file
View File

@@ -0,0 +1,3 @@
#pragma once
#define ICON_HOME "\ue88a"

View File

@@ -5,7 +5,7 @@
class WebWidget : public Gtk::Button {
public:
WebWidget(std::string label, std::string title, std::string url);
WebWidget(std::string icon, std::string title, std::string url);
~WebWidget() override;
private:

View File

@@ -2,6 +2,7 @@
all: unset;
}
window {
background-color: rgba(30, 30, 30, 0.8);
color: #ffffff;
@@ -21,24 +22,28 @@ window {
border-radius: 5px;
}
.workspace-pill:hover {
background-color: rgba(104, 104, 104, 0.2);
}
.workspace-pill:last-child {
margin-right: 0;
}
.workspace-pill-focused {
background-color: rgba(104, 104, 104, 0.3);
background-color: #ffffff;
color: #1e1e1e;
font-weight: bold;
border-bottom: #89b4fa 2px;
}
.workspace-pill-active {
background-color: rgba(168, 168, 168, 0.4);
background-color: rgba(255, 255, 255, 0.2);
}
.workspace-pill-urgent {
background-color: #ff5555;
color: #111;
color: #fff;
}
.workspace-pill:last-child {
margin-right: 0;
}
.workspace-pill:hover {
background-color: rgba(255, 255, 255, 0.1);
}
.minimized {
@@ -49,7 +54,6 @@ window {
background-color: transparent;
}
button {
padding: 2px 5px;
margin: 0 2px;
@@ -59,13 +63,10 @@ button {
border: none;
}
/* Hover effect: slightly brighten background and show pointer */
button:hover {
background-color: #111111;
}
#spacer {
color: rgba(255, 255, 255, 0.3);
padding: 0 5px;
@@ -83,3 +84,8 @@ tooltip {
font-family: "IBMPlexSans-Regular", sans-serif;
padding: 5px 10px;
}
.icon-label {
font-family: "Material Icons, Hack Nerd Font Mono";
font-size: 19px;
}

View File

@@ -217,8 +217,8 @@ void HyprlandService::refresh_workspaces() {
state.id = slot;
state.hyprId = -1;
state.label = std::to_string(slot);
state.focused = (slot == focusedSlot);
state.active = state.focused;
state.active = (slot == focusedSlot);
state.focused = state.focused;
state.urgent = false;
monitor.workspaceStates.emplace(slot, state);
}

View File

@@ -1,9 +1,13 @@
#include "widgets/webWidget.hpp"
#include <gtkmm/box.h>
#include <gtkmm/label.h>
#include <webkit/webkit.h>
WebWidget::WebWidget(std::string label, std::string title, std::string url) {
set_label(label);
WebWidget::WebWidget(std::string icon, std::string title, std::string url) {
auto label = Gtk::make_managed<Gtk::Label>(icon);
label->add_css_class("icon-label");
set_child(*label);
signal_clicked().connect(
sigc::mem_fun(*this, &WebWidget::on_toggle_window));
@@ -23,12 +27,10 @@ WebWidget::WebWidget(std::string label, std::string title, std::string url) {
auto settings = webkit_web_view_get_settings(WEBKIT_WEB_VIEW(webview));
webkit_settings_set_hardware_acceleration_policy(
settings, WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS);
settings, WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER);
webkit_web_view_load_uri(WEBKIT_WEB_VIEW(webview), url.c_str());
// Use C API to set child because we don't have a C++ wrapper for
// WebKitWebView
gtk_popover_set_child(popover->gobj(), webview);
}