deine mum
This commit is contained in:
5
.clangd
Normal file
5
.clangd
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
CompileFlags:
|
||||||
|
Remove:
|
||||||
|
- -fmodules-ts
|
||||||
|
- -fmodule-mapper=*
|
||||||
|
- -fdeps-format=*
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
#include "widgets/tray.hpp"
|
#include "widgets/tray.hpp"
|
||||||
#include "widgets/webWidget.hpp"
|
#include "widgets/webWidget.hpp"
|
||||||
#include "widgets/workspaceIndicator.hpp"
|
#include "widgets/workspaceIndicator.hpp"
|
||||||
|
#include "icons.hpp"
|
||||||
|
|
||||||
class Bar : public Gtk::Window {
|
class Bar : public Gtk::Window {
|
||||||
public:
|
public:
|
||||||
@@ -25,7 +26,7 @@ class Bar : public Gtk::Window {
|
|||||||
private:
|
private:
|
||||||
Clock clock;
|
Clock clock;
|
||||||
Date date;
|
Date date;
|
||||||
WebWidget homeAssistant {"HA", "Home Assistant",
|
WebWidget homeAssistant {ICON_HOME, "Home Assistant",
|
||||||
"https://home.rivercry.com"};
|
"https://home.rivercry.com"};
|
||||||
TrayService &trayService;
|
TrayService &trayService;
|
||||||
HyprlandService &hyprlandService;
|
HyprlandService &hyprlandService;
|
||||||
|
|||||||
3
include/icons.hpp
Normal file
3
include/icons.hpp
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define ICON_HOME "\ue88a"
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
class WebWidget : public Gtk::Button {
|
class WebWidget : public Gtk::Button {
|
||||||
public:
|
public:
|
||||||
WebWidget(std::string label, std::string title, std::string url);
|
WebWidget(std::string icon, std::string title, std::string url);
|
||||||
~WebWidget() override;
|
~WebWidget() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
all: unset;
|
all: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
window {
|
window {
|
||||||
background-color: rgba(30, 30, 30, 0.8);
|
background-color: rgba(30, 30, 30, 0.8);
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
@@ -21,24 +22,28 @@ window {
|
|||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspace-pill:hover {
|
|
||||||
background-color: rgba(104, 104, 104, 0.2);
|
|
||||||
}
|
|
||||||
.workspace-pill:last-child {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.workspace-pill-focused {
|
.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 {
|
.workspace-pill-active {
|
||||||
background-color: rgba(168, 168, 168, 0.4);
|
background-color: rgba(255, 255, 255, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspace-pill-urgent {
|
.workspace-pill-urgent {
|
||||||
background-color: #ff5555;
|
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 {
|
.minimized {
|
||||||
@@ -49,7 +54,6 @@ window {
|
|||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
button {
|
button {
|
||||||
padding: 2px 5px;
|
padding: 2px 5px;
|
||||||
margin: 0 2px;
|
margin: 0 2px;
|
||||||
@@ -59,13 +63,10 @@ button {
|
|||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hover effect: slightly brighten background and show pointer */
|
|
||||||
button:hover {
|
button:hover {
|
||||||
background-color: #111111;
|
background-color: #111111;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#spacer {
|
#spacer {
|
||||||
color: rgba(255, 255, 255, 0.3);
|
color: rgba(255, 255, 255, 0.3);
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
@@ -82,4 +83,9 @@ tooltip {
|
|||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
font-family: "IBMPlexSans-Regular", sans-serif;
|
font-family: "IBMPlexSans-Regular", sans-serif;
|
||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-label {
|
||||||
|
font-family: "Material Icons, Hack Nerd Font Mono";
|
||||||
|
font-size: 19px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -217,8 +217,8 @@ void HyprlandService::refresh_workspaces() {
|
|||||||
state.id = slot;
|
state.id = slot;
|
||||||
state.hyprId = -1;
|
state.hyprId = -1;
|
||||||
state.label = std::to_string(slot);
|
state.label = std::to_string(slot);
|
||||||
state.focused = (slot == focusedSlot);
|
state.active = (slot == focusedSlot);
|
||||||
state.active = state.focused;
|
state.focused = state.focused;
|
||||||
state.urgent = false;
|
state.urgent = false;
|
||||||
monitor.workspaceStates.emplace(slot, state);
|
monitor.workspaceStates.emplace(slot, state);
|
||||||
}
|
}
|
||||||
@@ -384,4 +384,4 @@ void HyprlandService::handle_urgent_window(std::string windowAddress) {
|
|||||||
workspaceStateChanged.emit(monitor.id);
|
workspaceStateChanged.emit(monitor.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
#include "widgets/webWidget.hpp"
|
#include "widgets/webWidget.hpp"
|
||||||
#include <gtkmm/box.h>
|
#include <gtkmm/box.h>
|
||||||
|
#include <gtkmm/label.h>
|
||||||
#include <webkit/webkit.h>
|
#include <webkit/webkit.h>
|
||||||
|
|
||||||
WebWidget::WebWidget(std::string label, std::string title, std::string url) {
|
WebWidget::WebWidget(std::string icon, std::string title, std::string url) {
|
||||||
set_label(label);
|
auto label = Gtk::make_managed<Gtk::Label>(icon);
|
||||||
|
label->add_css_class("icon-label");
|
||||||
|
set_child(*label);
|
||||||
|
|
||||||
signal_clicked().connect(
|
signal_clicked().connect(
|
||||||
sigc::mem_fun(*this, &WebWidget::on_toggle_window));
|
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));
|
auto settings = webkit_web_view_get_settings(WEBKIT_WEB_VIEW(webview));
|
||||||
webkit_settings_set_hardware_acceleration_policy(
|
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());
|
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);
|
gtk_popover_set_child(popover->gobj(), webview);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user