29 #include "headerbar.h" |
29 #include "headerbar.h" |
30 |
30 |
31 #include "button.h" |
31 #include "button.h" |
32 #include "menu.h" |
32 #include "menu.h" |
33 |
33 |
34 #if GTK_MAJOR_VERSION >= 3 |
34 #if GTK_CHECK_VERSION(3, 10, 0) |
35 |
|
36 #ifdef UI_LIBADWAITA |
|
37 #define UI_HEADERBAR AdwHeaderBar* |
|
38 #define UI_HEADERBAR_CAST(h) ADW_HEADER_BAR(h) |
|
39 #define UI_HEADERBAR_PACK_START(h, w) adw_header_bar_pack_start(ADW_HEADER_BAR(h), w) |
|
40 #define UI_HEADERBAR_PACK_END(h, w) adw_header_bar_pack_end(ADW_HEADER_BAR(h), w) |
|
41 #define UI_HEADERBAR_SET_TITLE_WIDGET(h, w) adw_header_bar_set_title_widget(ADW_HEADER_BAR(h), w) |
|
42 #else |
|
43 #define UI_HEADERBAR GtkHeaderBar* |
|
44 #define UI_HEADERBAR_CAST(h) GTK_HEADER_BAR(h) |
|
45 #define UI_HEADERBAR_PACK_START(h, w) gtk_header_bar_pack_start(GTK_HEADER_BAR(h), w) |
|
46 #define UI_HEADERBAR_PACK_END(h, w) gtk_header_bar_pack_end(GTK_HEADER_BAR(h), w) |
|
47 #if GTK_MAJOR_VERSION >= 4 |
|
48 #define UI_HEADERBAR_SET_TITLE_WIDGET(h, w) gtk_header_bar_set_title_widget(GTK_HEADER_BAR(h), w) |
|
49 #else |
|
50 #define UI_HEADERBAR_SET_TITLE_WIDGET(h, w) gtk_header_bar_set_custom_title(GTK_HEADER_BAR(h), w) |
|
51 #endif |
|
52 #endif |
|
53 |
35 |
54 void ui_fill_headerbar(UiObject *obj, GtkWidget *headerbar) { |
36 void ui_fill_headerbar(UiObject *obj, GtkWidget *headerbar) { |
55 CxList *left_defaults = uic_get_toolbar_defaults(UI_TOOLBAR_LEFT); |
37 CxList *left_defaults = uic_get_toolbar_defaults(UI_TOOLBAR_LEFT); |
56 CxList *center_defaults = uic_get_toolbar_defaults(UI_TOOLBAR_CENTER); |
38 CxList *center_defaults = uic_get_toolbar_defaults(UI_TOOLBAR_CENTER); |
57 CxList *right_defaults = uic_get_toolbar_defaults(UI_TOOLBAR_RIGHT); |
39 CxList *right_defaults = uic_get_toolbar_defaults(UI_TOOLBAR_RIGHT); |