refactor: Cleanup
This commit is contained in:
parent
c442e47f93
commit
0c64b64ff8
7 changed files with 178 additions and 242 deletions
|
@ -32,31 +32,15 @@ class bar : public xpp::event::sink<evt::button_press, evt::expose, evt::propert
|
|||
void parse(string data, bool force = false);
|
||||
|
||||
protected:
|
||||
void refresh_window();
|
||||
void create_monitor();
|
||||
void setup_monitor();
|
||||
void configure_geom();
|
||||
void restack_window();
|
||||
void map_window();
|
||||
void set_wmhints();
|
||||
|
||||
int get_centerx();
|
||||
int get_innerwidth();
|
||||
void reconfigure_window();
|
||||
|
||||
void handle(const evt::button_press& evt);
|
||||
void handle(const evt::expose& evt);
|
||||
void handle(const evt::property_notify& evt);
|
||||
|
||||
void on_alignment_change(const alignment align);
|
||||
void on_attribute_set(const attribute attr);
|
||||
void on_attribute_unset(const attribute attr);
|
||||
void on_attribute_toggle(const attribute attr);
|
||||
void on_action_block_open(const mousebtn btn, string cmd);
|
||||
void on_action_block_close(const mousebtn btn);
|
||||
void on_color_change(const gc gc_, uint32_t color);
|
||||
void on_font_change(int index);
|
||||
void on_pixel_offset(int px);
|
||||
void on_tray_report(uint16_t slots);
|
||||
|
||||
private:
|
||||
connection& m_connection;
|
||||
const config& m_conf;
|
||||
|
@ -64,17 +48,17 @@ class bar : public xpp::event::sink<evt::button_press, evt::expose, evt::propert
|
|||
unique_ptr<tray_manager> m_tray;
|
||||
unique_ptr<renderer> m_renderer;
|
||||
|
||||
bar_settings m_opts;
|
||||
xcb_window_t m_window;
|
||||
xcb_screen_t* m_screen;
|
||||
size m_screensize{};
|
||||
bool m_sinkattached{false};
|
||||
string m_lastinput;
|
||||
xcb_window_t m_window;
|
||||
|
||||
bar_settings m_opts;
|
||||
|
||||
alignment m_trayalign{alignment::NONE};
|
||||
uint8_t m_trayclients{0};
|
||||
|
||||
std::mutex m_mutex;
|
||||
|
||||
string m_lastinput;
|
||||
};
|
||||
|
||||
di::injector<unique_ptr<bar>> configure_bar();
|
||||
|
|
|
@ -62,7 +62,7 @@ struct line_settings {
|
|||
struct bar_settings {
|
||||
monitor_t monitor;
|
||||
|
||||
edge origin{edge::BOTTOM};
|
||||
edge origin{edge::TOP};
|
||||
|
||||
struct size size{0, 0};
|
||||
position pos{0, 0};
|
||||
|
@ -88,6 +88,17 @@ struct bar_settings {
|
|||
string locale;
|
||||
|
||||
bool force_docking{false};
|
||||
|
||||
const xcb_rectangle_t inner_area() const {
|
||||
xcb_rectangle_t rect{pos.x, pos.y, size.w, size.h};
|
||||
rect.y += borders.at(edge::TOP).size;
|
||||
rect.height -= borders.at(edge::TOP).size;
|
||||
rect.height -= borders.at(edge::BOTTOM).size;
|
||||
rect.x += borders.at(edge::LEFT).size;
|
||||
rect.width -= borders.at(edge::LEFT).size;
|
||||
rect.width -= borders.at(edge::RIGHT).size;
|
||||
return rect;
|
||||
}
|
||||
};
|
||||
|
||||
struct action_block {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue