1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-11 13:50:56 -05:00
polybar/include/modules/tray.hpp
raffael0 4961a7dcfc
feat(tray): Position using a module (#2595)
Closes: #1526
Closes: #314

* debug log

* semi-working prototype. works on the left and the center but not on the right

* fixes formatting

* fixes tests

* - fixed tray_width_change signal
- implements suggestions

* - fixes error with tray positioning

* - tries to fix tests. Does not work

* - fixes tests

* - implemented suggestions

* reverted formatting in comake and doc

* - changed unique_ptr to const reference

* - fixed formatting errors in code

* - actually fixed formatting(ran clang-format)

* - implemented suggestions

* - Added CHANGELOG.md entry(not sure about wording)

* - removed bar_settings from tray_manager::setup

* - fixed issue from rebase

* - fixed issue with tests from rebase

* implemented suggestions

* Update CHANGELOG.md

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
2022-04-15 23:50:04 +02:00

29 lines
772 B
C++

#pragma once
#include "common.hpp"
#include "components/bar.hpp"
#include "modules/meta/static_module.hpp"
POLYBAR_NS
namespace modules {
class tray_module : public static_module<tray_module>,
public signal_receiver<SIGN_PRIORITY_TRAY, signals::ui_tray::tray_width_change> {
public:
explicit tray_module(const bar_settings& bar_settings, string name_);
string get_format() const;
bool build(builder* builder, const string& tag) const;
void update() {}
void teardown();
bool on(const signals::ui_tray::tray_width_change& evt) override;
static constexpr auto TYPE = "internal/tray";
private:
static constexpr const char* TAG_TRAY{"<tray>"};
int m_width{0};
};
} // namespace modules
POLYBAR_NS_END