deine mum
This commit is contained in:
@@ -2,8 +2,43 @@
|
||||
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/button.h>
|
||||
#include <gtkmm/label.h>
|
||||
|
||||
#include "components/base/button.hpp"
|
||||
|
||||
|
||||
|
||||
class BluetoothEntry : Gtk::Box {
|
||||
public:
|
||||
BluetoothEntry(std::string name, std::string address) {
|
||||
this->set_orientation(Gtk::Orientation::VERTICAL);
|
||||
this->add_css_class("bluetooth-entry-box");
|
||||
|
||||
auto nameLabel = Gtk::make_managed<Gtk::Label>(name);
|
||||
nameLabel->set_halign(Gtk::Align::START);
|
||||
nameLabel->add_css_class("bluetooth-entry-name");
|
||||
this->append(*nameLabel);
|
||||
|
||||
auto addressLabel = Gtk::make_managed<Gtk::Label>(address);
|
||||
addressLabel->set_halign(Gtk::Align::START);
|
||||
addressLabel->add_css_class("bluetooth-entry-address");
|
||||
this->append(*addressLabel);
|
||||
|
||||
this->add_css_class("bluetooth-entry");
|
||||
|
||||
auto connectButton = Gtk::make_managed<Button>("Connect");
|
||||
connectButton->set_halign(Gtk::Align::END);
|
||||
connectButton->set_tooltip_text("Connect to Device");
|
||||
connectButton->onClickedSignal.connect([this, address]() {
|
||||
this->connect_clicked.emit(address);
|
||||
});
|
||||
this->append(*connectButton);
|
||||
}
|
||||
|
||||
sigc::signal<void(std::string)> connect_clicked;
|
||||
};
|
||||
|
||||
|
||||
class BluetoothWidget : public Gtk::Box {
|
||||
public:
|
||||
BluetoothWidget();
|
||||
@@ -21,7 +56,8 @@ class BluetoothWidget : public Gtk::Box {
|
||||
bool isDiscovering = false;
|
||||
|
||||
Gtk::Box statusArea;
|
||||
Gtk::Box *deviceList = nullptr;
|
||||
std::map<std::string, BluetoothEntry *> deviceEntries;
|
||||
Gtk::Box devicesArea;
|
||||
Button *scanButton = nullptr;
|
||||
Button *powerButton = nullptr;
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ button {
|
||||
animation: workspace-updown 1.2s ease-in-out infinite;
|
||||
margin-left: -4px;
|
||||
margin-top: 4px;
|
||||
font-size: 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.workspace-pill-seven {
|
||||
@@ -106,7 +106,7 @@ button {
|
||||
animation-delay: 0.6s;
|
||||
margin-right: -4px;
|
||||
margin-top: 4px;
|
||||
font-size: 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@keyframes workspace-updown {
|
||||
|
||||
@@ -29,8 +29,6 @@ App::App() {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
auto bar = new Bar(monitor->gobj(), hyprlandMonitor->id);
|
||||
|
||||
bar->set_application(app);
|
||||
@@ -40,6 +38,7 @@ App::App() {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
app->signal_shutdown().connect([&]() {
|
||||
for (auto bar : bars) {
|
||||
delete bar;
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <vector>
|
||||
|
||||
#include "glib.h"
|
||||
#include "sigc++/signal.h"
|
||||
|
||||
BluetoothService::BluetoothService() {
|
||||
GError *error = nullptr;
|
||||
|
||||
@@ -258,10 +258,10 @@ void HyprlandService::onUrgentEvent(std::string windowAddress) {
|
||||
auto it = this->workspaces.find(workspaceId);
|
||||
if (it != this->workspaces.end() && it->second) {
|
||||
|
||||
if (std::find(it->second->urgentWindows.begin(),
|
||||
it->second->urgentWindows.end(), windowAddress) ==
|
||||
it->second->urgentWindows.end()) {
|
||||
it->second->urgentWindows.push_back(windowAddress);
|
||||
WorkspaceState *ws = it->second;
|
||||
auto uit = std::find(ws->urgentWindows.begin(), ws->urgentWindows.end(), windowAddress);
|
||||
if (uit == ws->urgentWindows.end()) {
|
||||
ws->urgentWindows.push_back(windowAddress);
|
||||
workspaceStateChanged.emit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#include "widgets/bluetooth.hpp"
|
||||
#include "gtkmm/label.h"
|
||||
|
||||
|
||||
BluetoothWidget::BluetoothWidget() : Gtk::Box() {
|
||||
this->set_orientation(Gtk::Orientation::VERTICAL);
|
||||
|
||||
@@ -41,18 +41,17 @@ WorkspaceIndicator::WorkspaceIndicator(int monitorId)
|
||||
overlay->add_controller(gesture);
|
||||
overlay->add_css_class("workspace-pill");
|
||||
|
||||
// if (i == 6 || i == 7) {
|
||||
// auto indicator = Gtk::make_managed<Gtk::Label>(i == 6 ? "🫱🏻" : "🫲🏻");
|
||||
// indicator->add_css_class(i == 6 ? "workspace-pill-six" : "workspace-pill-seven");
|
||||
// indicator->set_valign(Gtk::Align::END);
|
||||
// indicator->set_halign(i == 6 ? Gtk::Align::START : Gtk::Align::END);
|
||||
// overlay->set_child(*indicator);
|
||||
// overlay->add_overlay(*numLabel);
|
||||
// pillContainer->append(*overlay);
|
||||
// } else {
|
||||
if (i == 6 || i == 7) {
|
||||
auto indicator = Gtk::make_managed<Gtk::Label>(i == 6 ? "🫱🏻" : "🫲🏻");
|
||||
indicator->add_css_class(i == 6 ? "workspace-pill-six" : "workspace-pill-seven");
|
||||
indicator->set_valign(Gtk::Align::END);
|
||||
overlay->set_child(*indicator);
|
||||
overlay->add_overlay(*numLabel);
|
||||
pillContainer->append(*overlay);
|
||||
} else {
|
||||
overlay->set_child(*numLabel);
|
||||
pillContainer->append(*overlay);
|
||||
// }
|
||||
}
|
||||
|
||||
append(*pillContainer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user