refactor: avoid Gio namespace pollution
This commit is contained in:
@ -6,14 +6,12 @@
|
|||||||
|
|
||||||
namespace waybar {
|
namespace waybar {
|
||||||
|
|
||||||
using namespace Gio;
|
|
||||||
|
|
||||||
enum class Appearance {
|
enum class Appearance {
|
||||||
UNKNOWN = 0,
|
UNKNOWN = 0,
|
||||||
DARK = 1,
|
DARK = 1,
|
||||||
LIGHT = 2,
|
LIGHT = 2,
|
||||||
};
|
};
|
||||||
class Portal : private DBus::Proxy {
|
class Portal : private Gio::DBus::Proxy {
|
||||||
public:
|
public:
|
||||||
Portal();
|
Portal();
|
||||||
void refreshAppearance();
|
void refreshAppearance();
|
||||||
|
@ -17,8 +17,6 @@ static constexpr const char* PORTAL_NAMESPACE = "org.freedesktop.appearance";
|
|||||||
static constexpr const char* PORTAL_KEY = "color-scheme";
|
static constexpr const char* PORTAL_KEY = "color-scheme";
|
||||||
} // namespace waybar
|
} // namespace waybar
|
||||||
|
|
||||||
using namespace Gio;
|
|
||||||
|
|
||||||
auto fmt::formatter<waybar::Appearance>::format(waybar::Appearance c, format_context& ctx) const {
|
auto fmt::formatter<waybar::Appearance>::format(waybar::Appearance c, format_context& ctx) const {
|
||||||
string_view name;
|
string_view name;
|
||||||
switch (c) {
|
switch (c) {
|
||||||
@ -36,8 +34,8 @@ auto fmt::formatter<waybar::Appearance>::format(waybar::Appearance c, format_con
|
|||||||
}
|
}
|
||||||
|
|
||||||
waybar::Portal::Portal()
|
waybar::Portal::Portal()
|
||||||
: DBus::Proxy(DBus::Connection::get_sync(DBus::BusType::BUS_TYPE_SESSION), PORTAL_BUS_NAME,
|
: Gio::DBus::Proxy(Gio::DBus::Connection::get_sync(Gio::DBus::BusType::BUS_TYPE_SESSION),
|
||||||
PORTAL_OBJ_PATH, PORTAL_INTERFACE),
|
PORTAL_BUS_NAME, PORTAL_OBJ_PATH, PORTAL_INTERFACE),
|
||||||
currentMode(Appearance::UNKNOWN) {
|
currentMode(Appearance::UNKNOWN) {
|
||||||
refreshAppearance();
|
refreshAppearance();
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user