mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-11-23 11:53:02 +00:00
fix geometry, groups and clicks still not working
This commit is contained in:
parent
ddfea5392c
commit
8e066f5f3b
5 changed files with 15 additions and 33 deletions
10
src/bar.c
10
src/bar.c
|
@ -178,9 +178,10 @@ void bar_calculate_bounds(struct bar* bar) {
|
|||
continue;
|
||||
|
||||
if (bar_item->position == POSITION_RIGHT
|
||||
|| bar_item->position == POSITION_CENTER_LEFT)
|
||||
|| bar_item->position == POSITION_CENTER_LEFT) {
|
||||
*next_position -= bar_item_display_length
|
||||
+ bar_item->background.padding_right;
|
||||
}
|
||||
else {
|
||||
*next_position += bar_item->background.padding_left;
|
||||
}
|
||||
|
@ -230,12 +231,13 @@ void bar_calculate_bounds(struct bar* bar) {
|
|||
|| bar_item->position == POSITION_CENTER_LEFT) {
|
||||
*next_position += bar_item->has_const_width
|
||||
? bar_item_display_length
|
||||
+ bar_item->background.padding_left
|
||||
+ bar_item->background.padding_right
|
||||
- bar_item->custom_width
|
||||
: bar_item->background.padding_right;
|
||||
: - bar_item->background.padding_left;
|
||||
} else {
|
||||
*next_position += bar_item->has_const_width
|
||||
? bar_item->custom_width - bar_item->background.padding_left
|
||||
? bar_item->custom_width
|
||||
- bar_item->background.padding_left
|
||||
: (bar_item_length
|
||||
+ bar_item->background.padding_right);
|
||||
}
|
||||
|
|
|
@ -495,11 +495,8 @@ void bar_item_set_bounding_rect_for_display(struct bar_item* bar_item, uint32_t
|
|||
}
|
||||
|
||||
uint32_t bar_item_calculate_bounds(struct bar_item* bar_item, uint32_t bar_height, uint32_t x, uint32_t y) {
|
||||
if (bar_item->lazy) {
|
||||
x = 0;
|
||||
}
|
||||
|
||||
uint32_t content_x = x;
|
||||
x = 0;
|
||||
uint32_t content_x = 0;
|
||||
uint32_t content_y = y;
|
||||
|
||||
uint32_t bar_item_length = bar_item_get_length(bar_item, false);
|
||||
|
@ -512,9 +509,6 @@ uint32_t bar_item_calculate_bounds(struct bar_item* bar_item, uint32_t bar_heigh
|
|||
}
|
||||
|
||||
uint32_t icon_position = content_x;
|
||||
// if ((int)content_x + bar_item->background.padding_left < 0)
|
||||
// icon_position = 0;
|
||||
//
|
||||
uint32_t label_position = icon_position + text_get_length(&bar_item->icon,
|
||||
false );
|
||||
|
||||
|
|
|
@ -260,27 +260,12 @@ bool bar_manager_set_topmost(struct bar_manager *bar_manager, bool topmost) {
|
|||
|
||||
void bar_manager_freeze(struct bar_manager *bar_manager) {
|
||||
bar_manager->frozen = true;
|
||||
for (int i = 0; i < bar_manager->bar_count; i++) {
|
||||
window_freeze(&bar_manager->bars[i]->window);
|
||||
}
|
||||
for (int i = 0; i < bar_manager->bar_item_count; i++) {
|
||||
if (!bar_manager->bar_items[i]->needs_update) continue;
|
||||
for (int j = 0; j < bar_manager->bar_items[i]->num_windows; j++) {
|
||||
window_freeze(bar_manager->bar_items[i]->windows[j]);
|
||||
}
|
||||
}
|
||||
windows_freeze();
|
||||
}
|
||||
|
||||
void bar_manager_unfreeze(struct bar_manager *bar_manager) {
|
||||
bar_manager->frozen = false;
|
||||
for (int i = 0; i < bar_manager->bar_count; i++) {
|
||||
window_unfreeze(&bar_manager->bars[i]->window);
|
||||
}
|
||||
for (int i = 0; i < bar_manager->bar_item_count; i++) {
|
||||
for (int j = 0; j < bar_manager->bar_items[i]->num_windows; j++) {
|
||||
window_unfreeze(bar_manager->bar_items[i]->windows[j]);
|
||||
}
|
||||
}
|
||||
windows_unfreeze();
|
||||
}
|
||||
|
||||
uint32_t bar_manager_length_for_bar_side(struct bar_manager* bar_manager, struct bar* bar, char side) {
|
||||
|
|
|
@ -47,11 +47,11 @@ void window_create(struct window* window, CGRect frame) {
|
|||
|
||||
}
|
||||
|
||||
void window_freeze(struct window* window) {
|
||||
void windows_freeze() {
|
||||
SLSDisableUpdate(g_connection);
|
||||
}
|
||||
|
||||
void window_unfreeze(struct window* window) {
|
||||
void windows_unfreeze() {
|
||||
SLSReenableUpdate(g_connection);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,11 +50,12 @@ struct window {
|
|||
void window_create(struct window* window, CGRect frame);
|
||||
void window_close(struct window* window);
|
||||
void window_resize(struct window* window, CGRect frame);
|
||||
void window_freeze(struct window* window);
|
||||
void window_unfreeze(struct window* window);
|
||||
|
||||
void window_set_blur_radius(struct window* window, uint32_t blur_radius);
|
||||
void window_disable_shadow(struct window* window);
|
||||
void window_set_level(struct window* window, uint32_t level);
|
||||
|
||||
void context_set_font_smoothing(CGContextRef context, bool smoothing);
|
||||
|
||||
void windows_freeze();
|
||||
void windows_unfreeze();
|
||||
|
|
Loading…
Reference in a new issue