fix code style

This commit is contained in:
2025-12-10 17:58:01 +01:00
parent 4d61a80a7c
commit 0b3a6c4696
19 changed files with 1016 additions and 1366 deletions

View File

@@ -6,8 +6,7 @@
#include "interface/updateable.ipp"
class Clock : public Gtk::Label, public IUpdatable
{
class Clock : public Gtk::Label, public IUpdatable {
public:
bool onUpdate();
};

View File

@@ -4,12 +4,9 @@
#include <gtkmm.h>
#include <gtkmm/label.h>
class Spacer : public Gtk::Label
{
class Spacer : public Gtk::Label {
public:
Spacer()
{
Spacer() {
set_hexpand(true);
set_text("|");
set_name("spacer");

View File

@@ -1,16 +1,16 @@
#pragma once
#include <giomm/menu.h>
#include <giomm/menuitem.h>
#include <giomm/menumodel.h>
#include <giomm/simpleaction.h>
#include <giomm/simpleactiongroup.h>
#include <gtkmm/box.h>
#include <gtkmm/button.h>
#include <gtkmm/gestureclick.h>
#include <gtkmm/picture.h>
#include <gtkmm/image.h>
#include <gtkmm/picture.h>
#include <gtkmm/popovermenu.h>
#include <giomm/menumodel.h>
#include <giomm/menu.h>
#include <giomm/menuitem.h>
#include <giomm/simpleaction.h>
#include <giomm/simpleactiongroup.h>
#include <map>
#include <memory>
@@ -18,53 +18,52 @@
#include "services/tray.hpp"
class TrayIconWidget : public Gtk::Button
{
class TrayIconWidget : public Gtk::Button {
public:
TrayIconWidget(TrayService &service, std::string id);
void update(const TrayService::Item &item);
private:
TrayService &m_service;
std::string m_id;
Gtk::Box m_container;
Gtk::Picture m_picture;
Gtk::Image m_image;
Glib::RefPtr<Gtk::GestureClick> m_primaryGesture;
Glib::RefPtr<Gtk::GestureClick> m_secondaryGesture;
Glib::RefPtr<Gtk::PopoverMenu> m_menuPopover;
Glib::RefPtr<Gio::SimpleActionGroup> m_menuActions;
Glib::RefPtr<Gio::MenuModel> m_menuModel;
sigc::connection m_menuChangedConnection;
bool m_menuPopupPending = false;
double m_pendingX = 0.0;
double m_pendingY = 0.0;
TrayService &service;
std::string id;
Gtk::Box container;
Gtk::Picture picture;
Gtk::Image image;
Glib::RefPtr<Gtk::GestureClick> primaryGesture;
Glib::RefPtr<Gtk::GestureClick> secondaryGesture;
Glib::RefPtr<Gtk::PopoverMenu> menuPopover;
Glib::RefPtr<Gio::SimpleActionGroup> menuActions;
Glib::RefPtr<Gio::MenuModel> menuModel;
sigc::connection menuChangedConnection;
bool menuPopupPending = false;
double pendingX = 0.0;
double pendingY = 0.0;
void on_primary_released(int n_press, double x, double y);
void on_secondary_released(int n_press, double x, double y);
bool ensure_menu();
void on_menu_items_changed(guint position, guint removed, guint added);
void try_popup();
void populate_menu_items(const std::vector<TrayService::MenuNode> &nodes,
const Glib::RefPtr<Gio::Menu> &menu,
const Glib::RefPtr<Gio::SimpleActionGroup> &actions);
void
populate_menu_items(const std::vector<TrayService::MenuNode> &nodes,
const Glib::RefPtr<Gio::Menu> &menu,
const Glib::RefPtr<Gio::SimpleActionGroup> &actions);
void on_menu_action(const Glib::VariantBase &parameter, int itemId);
};
class TrayWidget : public Gtk::Box
{
class TrayWidget : public Gtk::Box {
public:
explicit TrayWidget(TrayService &service);
~TrayWidget() override;
private:
TrayService &m_service;
std::map<std::string, std::unique_ptr<TrayIconWidget>> m_icons;
TrayService &service;
std::map<std::string, std::unique_ptr<TrayIconWidget>> icons;
sigc::connection m_addConnection;
sigc::connection m_removeConnection;
sigc::connection m_updateConnection;
sigc::connection addConnection;
sigc::connection removeConnection;
sigc::connection updateConnection;
void on_item_added(const TrayService::Item &item);
void on_item_removed(const std::string &id);

View File

@@ -1,11 +1,10 @@
#pragma once
#include <gtkmm.h>
#include <string>
#include <sigc++/sigc++.h>
#include <string>
class VolumeWidget : public Gtk::Box
{
class VolumeWidget : public Gtk::Box {
public:
VolumeWidget();
virtual ~VolumeWidget();
@@ -18,7 +17,7 @@ class VolumeWidget : public Gtk::Box
bool on_timeout();
private:
Gtk::Label m_label;
Glib::RefPtr<Gtk::GestureClick> m_click;
sigc::connection m_timeoutConn;
Gtk::Label label;
Glib::RefPtr<Gtk::GestureClick> click;
sigc::connection timeoutConn;
};

View File

@@ -6,17 +6,16 @@
#include "services/hyprland.hpp"
class WorkspaceIndicator : public Gtk::Box
{
class WorkspaceIndicator : public Gtk::Box {
public:
WorkspaceIndicator(HyprlandService &service, int monitorId);
~WorkspaceIndicator() override;
private:
HyprlandService &m_service;
int m_monitorId;
sigc::connection m_workspaceConnection;
sigc::connection m_monitorConnection;
HyprlandService &service;
int monitorId;
sigc::connection workspaceConnection;
sigc::connection monitorConnection;
void rebuild();
void on_workspace_update(int monitorId);