mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Introducce AAppIconLabel class
Implemented for hyprland
This commit is contained in:
26
include/AAppIconLabel.hpp
Normal file
26
include/AAppIconLabel.hpp
Normal file
@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/image.h>
|
||||
|
||||
#include "AIconLabel.hpp"
|
||||
|
||||
namespace waybar {
|
||||
|
||||
class AAppIconLabel : public AIconLabel {
|
||||
public:
|
||||
AAppIconLabel(const Json::Value &config, const std::string &name, const std::string &id,
|
||||
const std::string &format, uint16_t interval = 0, bool ellipsize = false,
|
||||
bool enable_click = false, bool enable_scroll = false);
|
||||
virtual ~AAppIconLabel() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
protected:
|
||||
void updateAppIconName(const std::string &app_identifier);
|
||||
void updateAppIcon();
|
||||
unsigned app_icon_size_{24};
|
||||
bool update_app_icon_{true};
|
||||
std::string app_icon_name_;
|
||||
};
|
||||
|
||||
} // namespace waybar
|
@ -1,13 +1,13 @@
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include "AIconLabel.hpp"
|
||||
#include "AAppIconLabel.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "modules/hyprland/backend.hpp"
|
||||
#include "util/json.hpp"
|
||||
|
||||
namespace waybar::modules::hyprland {
|
||||
|
||||
class Window : public waybar::AIconLabel, public EventHandler {
|
||||
class Window : public waybar::AAppIconLabel, public EventHandler {
|
||||
public:
|
||||
Window(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
virtual ~Window();
|
||||
@ -40,8 +40,6 @@ class Window : public waybar::AIconLabel, public EventHandler {
|
||||
void onEvent(const std::string&) override;
|
||||
void queryActiveWorkspace();
|
||||
void setClass(const std::string&, bool enable);
|
||||
void updateAppIconName();
|
||||
void updateAppIcon();
|
||||
|
||||
bool separate_outputs;
|
||||
std::mutex mutex_;
|
||||
@ -55,9 +53,6 @@ class Window : public waybar::AIconLabel, public EventHandler {
|
||||
bool all_floating_;
|
||||
bool hidden_;
|
||||
bool fullscreen_;
|
||||
unsigned app_icon_size_{24};
|
||||
bool update_app_icon_{true};
|
||||
std::string app_icon_name_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::hyprland
|
||||
|
Reference in New Issue
Block a user