clang format

This commit is contained in:
2026-02-09 13:50:26 +01:00
parent e1217305a5
commit ea9ab4b2cb
19 changed files with 66 additions and 67 deletions

View File

@@ -71,11 +71,11 @@ class Timer : public Gtk::Box {
}
void updateTimeLeft(uint64_t timeValue) {
uint64_t s = timeValue % 100;
uint64_t m = (timeValue / 100) % 100;
uint64_t h = timeValue / 10000;
uint64_t s = timeValue % 100;
uint64_t m = (timeValue / 100) % 100;
uint64_t h = timeValue / 10000;
uint64_t totalSeconds = h * 3600 + m * 60 + s;
this->timeLeft = totalSeconds;
this->timeLeft = totalSeconds;
std::ostringstream out;
if (h > 0) {

View File

@@ -4,8 +4,8 @@
#include <array>
#include <cassert>
#include <cstring>
#include <span>
#include <nlohmann/json.hpp>
#include <span>
#include <string>
#include <sys/socket.h>
#include <sys/un.h>
@@ -57,7 +57,7 @@ class HyprctlHelper {
int socketFd = socket(AF_UNIX, SOCK_STREAM, 0);
assert(socketFd != -1 && "Failed to create Hyprland command socket");
struct sockaddr_un addr {};
struct sockaddr_un addr{};
std::memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
@@ -78,7 +78,7 @@ class HyprctlHelper {
std::string response;
constexpr size_t kBufferSize = 4096;
std::array<char, kBufferSize> buffer {};
std::array<char, kBufferSize> buffer{};
while (true) {
ssize_t bytesRead = recv(socketFd, buffer.data(), buffer.size(), 0);
if (bytesRead <= 0) {

View File

@@ -46,7 +46,7 @@ class StringHelper {
while (len > 0 && (static_cast<unsigned char>(input[len]) & 0xC0) == 0x80) {
len--;
}
return input.substr(0, len) + "...";
}
};

View File

@@ -19,7 +19,6 @@
class HyprlandService {
static inline std::shared_ptr<HyprlandService> instance;
public:
struct Client {
std::string address;
@@ -66,7 +65,7 @@ class HyprlandService {
private:
HyprlandService();
enum SocketEventType {
WORKSPACE_CHANGED,
@@ -92,7 +91,7 @@ class HyprlandService {
{"monitorremoved", MONITOR_REMOVED},
{"monitoradded", MONITOR_ADDED},
};
void onWorkspaceChanged(int workspaceId);
void onFocusedMonitorChanged(std::string monitorData);
void onOpenWindow(std::string windowData);

View File

@@ -12,7 +12,7 @@
#include "gdkmm/monitor.h"
class NotificationController {
inline static std::shared_ptr<NotificationController> instance = nullptr;
inline static std::shared_ptr<NotificationController> instance = nullptr;
public:
static std::shared_ptr<NotificationController> getInstance() {

View File

@@ -49,7 +49,6 @@ class TimerService {
}
ringingTimerCounter++;
}
void removeTimer(uint64_t timerId) {

View File

@@ -15,7 +15,6 @@ class BluetoothSettingsRow : public Gtk::Box {
set_spacing(10);
set_margin_bottom(6);
if (!device.icon.empty()) {
this->icon.set_from_icon_name(device.icon);
this->icon.set_pixel_size(24);
@@ -94,16 +93,13 @@ class BluetoothSettings : public Gtk::Box {
std::map<std::string, BluetoothDevice> activeBluetoothDevices;
std::map<std::string, std::shared_ptr<BluetoothSettingsRow>> deviceRows;
std::shared_ptr<IconButton> powerButton = std::make_shared<IconButton>(Icon::POWER_SETTINGS_NEW);
std::shared_ptr<IconButton> scanButton = std::make_shared<IconButton>(Icon::BLUETOOTH_SEARCHING);
std::shared_ptr<IconButton> scanButton = std::make_shared<IconButton>(Icon::BLUETOOTH_SEARCHING);
Gtk::Box connectedDevicesBox;
Gtk::Box availableDevicesBox;
bool bluetoothIsPowered = false;
bool bluetoothIsPowered = false;
bool bluetoothIsScanning = false;
void addBluetoothDevice(const BluetoothDevice &device);

View File

@@ -1,10 +1,10 @@
#pragma once
#include "components/mediaPlayer.hpp"
#include <map>
#include <memory>
#include <string>
#include "components/mediaPlayer.hpp"
#include "connection/dbus/mpris.hpp"
#include "gtkmm/box.h"

View File

@@ -1,14 +1,16 @@
#pragma once
#include <map>
#include "connection/dbus/bluetooth.hpp"
#include "widgets/controlCenter/bluetoothSettings.hpp"
#include "gtkmm/box.h"
class SettingsWidget : public Gtk::Box {
public:
SettingsWidget();
private:
private:
BluetoothSettings bluetoothSettings;
};

View File

@@ -3,8 +3,10 @@
#include <memory>
#include <sigc++/connection.h>
#include <sys/types.h>
#include "components/timer.hpp"
#include "services/timerService.hpp"
#include "gtkmm/box.h"
class TimerWidget : public Gtk::Box {
@@ -17,7 +19,7 @@ class TimerWidget : public Gtk::Box {
private:
std::shared_ptr<TimerService> timerService = TimerService::getInstance();
bool updatingText = false;
bool updatingText = false;
std::string rawDigits;
std::map<uint64_t, std::unique_ptr<Timer>> activeTimers;