Make right-click to circle down ppd
This commit is contained in:
parent
2c927de4c6
commit
67218d5554
|
@ -39,6 +39,7 @@ PowerProfilesDaemon::PowerProfilesDaemon(const std::string& id, const Json::Valu
|
||||||
// adresses for compatibility sake.
|
// adresses for compatibility sake.
|
||||||
//
|
//
|
||||||
// Revisit this in 2026, systems should be updated by then.
|
// Revisit this in 2026, systems should be updated by then.
|
||||||
|
|
||||||
Gio::DBus::Proxy::create_for_bus(Gio::DBus::BusType::BUS_TYPE_SYSTEM, "net.hadess.PowerProfiles",
|
Gio::DBus::Proxy::create_for_bus(Gio::DBus::BusType::BUS_TYPE_SYSTEM, "net.hadess.PowerProfiles",
|
||||||
"/net/hadess/PowerProfiles", "net.hadess.PowerProfiles",
|
"/net/hadess/PowerProfiles", "net.hadess.PowerProfiles",
|
||||||
sigc::mem_fun(*this, &PowerProfilesDaemon::busConnectedCb));
|
sigc::mem_fun(*this, &PowerProfilesDaemon::busConnectedCb));
|
||||||
|
@ -175,10 +176,17 @@ auto PowerProfilesDaemon::update() -> void {
|
||||||
|
|
||||||
bool PowerProfilesDaemon::handleToggle(GdkEventButton* const& e) {
|
bool PowerProfilesDaemon::handleToggle(GdkEventButton* const& e) {
|
||||||
if (e->type == GdkEventType::GDK_BUTTON_PRESS && connected_) {
|
if (e->type == GdkEventType::GDK_BUTTON_PRESS && connected_) {
|
||||||
|
if (e->button == 1) /* left click */ {
|
||||||
activeProfile_++;
|
activeProfile_++;
|
||||||
if (activeProfile_ == availableProfiles_.end()) {
|
if (activeProfile_ == availableProfiles_.end()) {
|
||||||
activeProfile_ = availableProfiles_.begin();
|
activeProfile_ = availableProfiles_.begin();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (activeProfile_ == availableProfiles_.begin()) {
|
||||||
|
activeProfile_ = availableProfiles_.end();
|
||||||
|
}
|
||||||
|
activeProfile_--;
|
||||||
|
}
|
||||||
|
|
||||||
using VarStr = Glib::Variant<Glib::ustring>;
|
using VarStr = Glib::Variant<Glib::ustring>;
|
||||||
using SetPowerProfileVar = Glib::Variant<std::tuple<Glib::ustring, Glib::ustring, VarStr>>;
|
using SetPowerProfileVar = Glib::Variant<std::tuple<Glib::ustring, Glib::ustring, VarStr>>;
|
||||||
|
|
Loading…
Reference in New Issue