Fix clang-format
This commit is contained in:
+15
-16
@@ -15,7 +15,7 @@ enum class GraphType { LINE, BAR, GAUGE };
|
|||||||
|
|
||||||
class AGraph : public AModule {
|
class AGraph : public AModule {
|
||||||
public:
|
public:
|
||||||
AGraph(const Json::Value &, const std::string &, const std::string &, uint16_t interval = 0,
|
AGraph(const Json::Value&, const std::string&, const std::string&, uint16_t interval = 0,
|
||||||
bool enable_click = false, bool enable_scroll = false);
|
bool enable_click = false, bool enable_scroll = false);
|
||||||
virtual ~AGraph() = default;
|
virtual ~AGraph() = default;
|
||||||
auto update() -> void override;
|
auto update() -> void override;
|
||||||
@@ -30,29 +30,28 @@ class AGraph : public AModule {
|
|||||||
|
|
||||||
const std::chrono::seconds interval_;
|
const std::chrono::seconds interval_;
|
||||||
|
|
||||||
bool onDraw(const Cairo::RefPtr<Cairo::Context> &cr);
|
bool onDraw(const Cairo::RefPtr<Cairo::Context>& cr);
|
||||||
|
|
||||||
std::map<std::string, GtkMenuItem *> submenus_;
|
std::map<std::string, GtkMenuItem*> submenus_;
|
||||||
std::map<std::string, std::string> menuActionsMap_;
|
std::map<std::string, std::string> menuActionsMap_;
|
||||||
static void handleGtkMenuEvent(GtkMenuItem *menuitem, gpointer data);
|
static void handleGtkMenuEvent(GtkMenuItem* menuitem, gpointer data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void drawFilledArea(const Cairo::RefPtr<Cairo::Context> &cr,
|
void drawFilledArea(const Cairo::RefPtr<Cairo::Context>& cr,
|
||||||
const std::vector<std::pair<double, double>> &points, double height,
|
const std::vector<std::pair<double, double>>& points, double height,
|
||||||
const Gdk::RGBA &bg_color);
|
const Gdk::RGBA& bg_color);
|
||||||
|
|
||||||
void drawLine(const Cairo::RefPtr<Cairo::Context> &cr,
|
void drawLine(const Cairo::RefPtr<Cairo::Context>& cr,
|
||||||
const std::vector<std::pair<double, double>> &points, const Gdk::RGBA &fg_color);
|
const std::vector<std::pair<double, double>>& points, const Gdk::RGBA& fg_color);
|
||||||
|
|
||||||
void drawPath(const Cairo::RefPtr<Cairo::Context> &cr,
|
void drawPath(const Cairo::RefPtr<Cairo::Context>& cr,
|
||||||
const std::vector<std::pair<double, double>> &points);
|
const std::vector<std::pair<double, double>>& points);
|
||||||
|
|
||||||
void drawBars(const Cairo::RefPtr<Cairo::Context> &cr,
|
void drawBars(const Cairo::RefPtr<Cairo::Context>& cr, double width, double height,
|
||||||
double width, double height, int current_value,
|
int current_value, const Gdk::RGBA& fg_color);
|
||||||
const Gdk::RGBA &fg_color);
|
|
||||||
|
|
||||||
void drawGauge(const Cairo::RefPtr<Cairo::Context> &cr, double width, double height,
|
void drawGauge(const Cairo::RefPtr<Cairo::Context>& cr, double width, double height,
|
||||||
int current_value, const Gdk::RGBA &fg_color);
|
int current_value, const Gdk::RGBA& fg_color);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace waybar
|
} // namespace waybar
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ class CpuGraph : public AGraph {
|
|||||||
auto update() -> void override;
|
auto update() -> void override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr const char *MODERATE_CLASS = "cpu-moderate";
|
static constexpr const char* MODERATE_CLASS = "cpu-moderate";
|
||||||
static constexpr const char *HIGH_CLASS = "cpu-high";
|
static constexpr const char* HIGH_CLASS = "cpu-high";
|
||||||
static constexpr const char *INTENSIVE_CLASS = "cpu-intensive";
|
static constexpr const char* INTENSIVE_CLASS = "cpu-intensive";
|
||||||
|
|
||||||
std::vector<std::tuple<size_t, size_t>> prev_times_;
|
std::vector<std::tuple<size_t, size_t>> prev_times_;
|
||||||
util::SleeperThread thread_;
|
util::SleeperThread thread_;
|
||||||
|
|||||||
+3
-3
@@ -43,11 +43,11 @@
|
|||||||
#include "modules/niri/workspaces.hpp"
|
#include "modules/niri/workspaces.hpp"
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_MANGO
|
#ifdef HAVE_MANGO
|
||||||
#include "modules/mango/language.hpp"
|
|
||||||
#include "modules/mango/keymode.hpp"
|
#include "modules/mango/keymode.hpp"
|
||||||
|
#include "modules/mango/language.hpp"
|
||||||
|
#include "modules/mango/layout.hpp"
|
||||||
#include "modules/mango/window.hpp"
|
#include "modules/mango/window.hpp"
|
||||||
#include "modules/mango/workspaces.hpp"
|
#include "modules/mango/workspaces.hpp"
|
||||||
#include "modules/mango/layout.hpp"
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_WAYFIRE
|
#ifdef HAVE_WAYFIRE
|
||||||
#include "modules/wayfire/window.hpp"
|
#include "modules/wayfire/window.hpp"
|
||||||
@@ -58,8 +58,8 @@
|
|||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_CPU_LINUX) || defined(HAVE_CPU_BSD)
|
#if defined(HAVE_CPU_LINUX) || defined(HAVE_CPU_BSD)
|
||||||
#include "modules/cpu.hpp"
|
#include "modules/cpu.hpp"
|
||||||
#include "modules/cpu_graph.hpp"
|
|
||||||
#include "modules/cpu_frequency.hpp"
|
#include "modules/cpu_frequency.hpp"
|
||||||
|
#include "modules/cpu_graph.hpp"
|
||||||
#include "modules/cpu_usage.hpp"
|
#include "modules/cpu_usage.hpp"
|
||||||
#include "modules/load.hpp"
|
#include "modules/load.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -175,9 +175,8 @@ auto waybar::modules::CustomGraph::update() -> void {
|
|||||||
if (tooltipEnabled()) {
|
if (tooltipEnabled()) {
|
||||||
if (tooltip_format_enabled_) {
|
if (tooltip_format_enabled_) {
|
||||||
auto tooltip = config_["tooltip-format"].asString();
|
auto tooltip = config_["tooltip-format"].asString();
|
||||||
tooltip = fmt::format(
|
tooltip = fmt::format(fmt::runtime(tooltip), fmt::arg("text", text_),
|
||||||
fmt::runtime(tooltip), fmt::arg("text", text_), fmt::arg("alt", alt_),
|
fmt::arg("alt", alt_), fmt::arg("percentage", percentage_));
|
||||||
fmt::arg("percentage", percentage_));
|
|
||||||
graph_.set_tooltip_markup(tooltip);
|
graph_.set_tooltip_markup(tooltip);
|
||||||
} else {
|
} else {
|
||||||
if (graph_.get_tooltip_markup() != tooltip_) {
|
if (graph_.get_tooltip_markup() != tooltip_) {
|
||||||
|
|||||||
Reference in New Issue
Block a user