From 6aa9232f5bd4e285b9fb3c6ca46c6417b766a5e5 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Wed, 4 Feb 2026 18:15:22 +0600 Subject: [PATCH] WIP map status box --- source/ubinstall-gtk-region.c | 32 +++++- source/ubinstall-gtk.c | 13 ++- source/ubinstall-gtk.h | 10 +- source/ubl-strings.h | 2 + ubinstall-gtk.css | 11 ++ ubinstall-gtk.glade | 203 +++++++++++++++++++++------------- 6 files changed, 188 insertions(+), 83 deletions(-) diff --git a/source/ubinstall-gtk-region.c b/source/ubinstall-gtk-region.c index dc1f59e..7a5e19c 100644 --- a/source/ubinstall-gtk-region.c +++ b/source/ubinstall-gtk-region.c @@ -41,8 +41,32 @@ void on_region_changed(GtkComboBox *self, main_window *widgets){ #ifdef TIMEZONEMAP_INCLUDE void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,main_window *); + +void yon_map_status_hide(main_window *widgets){ + gtk_widget_hide(widgets->TimeZoneMapOverlayBox); +} + +void yon_map_status_hide_timeout(main_window *widgets){ + g_idle_add_once((GSourceOnceFunc)yon_map_status_hide,widgets); + +} + +void yon_map_status_show(main_window *widgets, char *icon_name, char *title, char *title_info){ + gtk_widget_show(widgets->TimeZoneMapOverlayBox); + gtk_label_set_text(GTK_LABEL(widgets->TimeZoneMapOverlayTitleLabel),title); + gtk_label_set_text(GTK_LABEL(widgets->TimeZoneMapOverlayInfoLabel),title_info); + if (!yon_char_is_empty(icon_name)){ + gtk_widget_show(widgets->TimeZoneMapOverlayImage); + GtkIconInfo *info = gtk_icon_theme_lookup_icon_for_scale(gtk_icon_theme_get_default(), icon_path, 48,1,GTK_ICON_LOOKUP_FORCE_SIZE); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->TimeZoneMapOverlayImage),gtk_icon_info_load_icon(info,NULL)); + } else { + gtk_widget_hide(widgets->TimeZoneMapOverlayImage); + } + g_timeout_add_seconds_once(5,(GSourceOnceFunc)yon_map_status_hide_timeout,widgets); +} + void on_zone_changed(GtkWidget *, main_window *widgets){ - g_signal_handlers_block_by_func(G_OBJECT(widgets->RegionMapTarget),G_CALLBACK(on_map_selection_changed),widgets); + // g_signal_handlers_block_by_func(G_OBJECT(widgets->RegionMapTarget),G_CALLBACK(on_map_selection_changed),widgets); const char *region = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->RegionCombo)); const char *zone = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->ZoneCombo)); @@ -51,7 +75,7 @@ void on_zone_changed(GtkWidget *, main_window *widgets){ cc_timezone_map_set_timezone(CC_TIMEZONE_MAP(widgets->RegionMapTarget),timezone); free(timezone); } - g_signal_handlers_unblock_by_func(G_OBJECT(widgets->RegionMapTarget),G_CALLBACK(on_map_selection_changed),widgets); + // g_signal_handlers_unblock_by_func(G_OBJECT(widgets->RegionMapTarget),G_CALLBACK(on_map_selection_changed),widgets); } void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,main_window *widgets){ @@ -75,10 +99,10 @@ void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,main_wind } } + + yon_map_status_show(widgets,NULL,MAP_TITLE_LABEL,MAP_INFO_LABEL); g_signal_handlers_unblock_by_func(G_OBJECT(widgets->ZoneCombo),G_CALLBACK(on_zone_changed),widgets); g_signal_handlers_unblock_by_func(G_OBJECT(widgets->RegionEntry),G_CALLBACK(on_region_entry_changed),widgets); - - } #endif diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index e366cfb..1f480d8 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -588,6 +588,11 @@ void yon_main_window_create(main_window *widgets){ widgets->RegionEntry = yon_gtk_builder_get_widget(builder,"RegionEntry"); widgets->RegionTimezoneCompletionList = GTK_LIST_STORE(gtk_builder_get_object(builder,"RegionTimezoneCompletionList")); widgets->RegionTimezoneCompletionFilter = GTK_TREE_MODEL_FILTER(gtk_builder_get_object(builder,"RegionTimezoneCompletionFilter")); + widgets->RegionMapOverlay = yon_gtk_builder_get_widget(builder,"RegionMapOverlay"); + widgets->TimeZoneMapOverlayBox = yon_gtk_builder_get_widget(builder,"TimeZoneMapOverlayBox"); + widgets->TimeZoneMapOverlayImage = yon_gtk_builder_get_widget(builder,"TimeZoneMapOverlayImage"); + widgets->TimeZoneMapOverlayTitleLabel = yon_gtk_builder_get_widget(builder,"TimeZoneMapOverlayTitleLabel"); + widgets->TimeZoneMapOverlayInfoLabel = yon_gtk_builder_get_widget(builder,"TimeZoneMapOverlayInfoLabel"); widgets->UserRootNameEntry=yon_gtk_builder_get_widget(builder,"UserRootNameEntry"); widgets->UserRootLoginEntry=yon_gtk_builder_get_widget(builder,"UserRootLoginEntry"); @@ -918,14 +923,16 @@ void yon_main_window_create(main_window *widgets){ gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(widgets->InstallerCountryFilter),(GtkTreeModelFilterVisibleFunc)on_country_filter,widgets,NULL); gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(widgets->LanguagesTree),(GtkTreeViewSearchEqualFunc)on_languages_search_func,widgets,NULL); + gtk_overlay_add_overlay(GTK_OVERLAY(widgets->RegionMapOverlay),widgets->TimeZoneMapOverlayBox); + gtk_widget_hide(widgets->TimeZoneMapOverlayBox); { widgets->EnableRDPMenuItem = gtk_menu_item_new(); GtkWidget *Box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5); GtkWidget *Label = gtk_label_new(ENABLE_RDP_LABEL); GtkWidget *Check = gtk_check_button_new(); - gtk_box_pack_start(GTK_BOX(Box),Label,0,0,0); gtk_box_pack_start(GTK_BOX(Box),Check,0,0,0); + gtk_box_pack_start(GTK_BOX(Box),Label,0,0,0); gtk_container_add(GTK_CONTAINER(widgets->EnableRDPMenuItem),Box); g_signal_connect(G_OBJECT(widgets->EnableRDPMenuItem),"activate",G_CALLBACK(on_rdp_toggled),widgets); gtk_style_context_add_class(gtk_widget_get_style_context(widgets->EnableRDPMenuItem),"menuitemmiddle"); @@ -937,8 +944,8 @@ void yon_main_window_create(main_window *widgets){ GtkWidget *Box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5); GtkWidget *Label = gtk_label_new(ENABLE_VNC_LABEL); GtkWidget *Check = gtk_check_button_new(); - gtk_box_pack_start(GTK_BOX(Box),Label,0,0,0); gtk_box_pack_start(GTK_BOX(Box),Check,0,0,0); + gtk_box_pack_start(GTK_BOX(Box),Label,0,0,0); gtk_container_add(GTK_CONTAINER(widgets->EnableVNCMenuItem),Box); g_signal_connect(G_OBJECT(widgets->EnableVNCMenuItem),"activate",G_CALLBACK(on_vnc_toggled),widgets); gtk_style_context_add_class(gtk_widget_get_style_context(widgets->EnableVNCMenuItem),"menuitemmiddle"); @@ -950,8 +957,8 @@ void yon_main_window_create(main_window *widgets){ GtkWidget *Box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5); GtkWidget *Label = gtk_label_new(CONFIGURATION_MODE_LABEL); GtkWidget *Check = gtk_check_button_new(); - gtk_box_pack_start(GTK_BOX(Box),Label,0,0,0); gtk_box_pack_start(GTK_BOX(Box),Check,0,0,0); + gtk_box_pack_start(GTK_BOX(Box),Label,0,0,0); gtk_container_add(GTK_CONTAINER(widgets->ConfigurationModeMenuItem),Box); g_signal_connect(G_OBJECT(widgets->ConfigurationModeMenuItem),"activate",G_CALLBACK(on_configuration_mode_switch),widgets); gtk_style_context_add_class(gtk_widget_get_style_context(widgets->ConfigurationModeMenuItem),"menuitemmiddle"); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 76b7c80..cb5dcfb 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -500,7 +500,12 @@ typedef struct // GtkWidget *LanguageCombo; GtkWidget *RegionMapBox; + GtkWidget *RegionMapOverlay; GtkWidget *RegionMapTarget; + GtkWidget *TimeZoneMapOverlayBox; + GtkWidget *TimeZoneMapOverlayImage; + GtkWidget *TimeZoneMapOverlayTitleLabel; + GtkWidget *TimeZoneMapOverlayInfoLabel; GtkWidget *RegionSensitiveSwitch; GtkWidget *RegionCombo; GtkWidget *ZoneCombo; @@ -1483,4 +1488,7 @@ void on_network_removed(GtkWidget *,network_info *info); char *yon_bootloader_get_os_name(char *parameter); gboolean on_region_refilter(GtkTreeModel* model, GtkTreeIter* iter, main_window *widgets); void on_region_entry_changed(GtkWidget *, main_window *widgets); -char *yon_size_get_name_from_letter(char letter); \ No newline at end of file +char *yon_size_get_name_from_letter(char letter); +void yon_map_status_hide(main_window *widgets); +void yon_map_status_hide_timeout(main_window *widgets); +void yon_map_status_show(main_window *widgets, char *icon_name, char *title, char *title_info); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 62d21c2..ebb84f5 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -290,6 +290,8 @@ NULL) #define REBOOT_LABEL _("Reboot") #define SHUTDOWN_LABEL _("Shudown") #define FINISH_ACTION_LABEL _("After successful installation:") +#define MAP_TITLE_LABEL _("Feasf") +#define MAP_INFO_LABEL _("Geasfa") // #define _LABEL _("Select your language:") // #define _LABEL _("Selecting additional system kernel components") diff --git a/ubinstall-gtk.css b/ubinstall-gtk.css index 78c51dd..ad241fa 100644 --- a/ubinstall-gtk.css +++ b/ubinstall-gtk.css @@ -371,4 +371,15 @@ button { .yellowBox > trough > progress{ background-color: #f3f0ac; +} + +.timezoneoverlay * { + color:@theme_bg_color; + background-color: @theme_fg_color; +} + +.timezoneoverlay { + background-color: @theme_fg_color; + opacity:0.7; + border-radius:10px; } \ No newline at end of file diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 9ad3676..9edae9f 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -320,6 +320,72 @@ + + True + False + center + center + vertical + + + 175 + 100 + True + False + 5 + 5 + 5 + 5 + vertical + 5 + + + True + False + 48 + com.ublinux.libublsettingsui-gtk3.cancel-uncolored-symbolic + + + False + True + 0 + + + + + True + False + label + + + False + True + 1 + + + + + True + False + label + + + False + True + 2 + + + + + True + True + 0 + + + + True False @@ -3698,99 +3764,77 @@ agreement True False center + vertical 5 - - - True - True - - - False - True - 0 - - - - - True - Region: - - - False - True - 1 - - + True False 5 - + True - False - 15 - 5 - - - True - False - True - - - False - True - 1 - - + True - True - False + False + True 0 - + True - False - 15 - 5 - - - False - Zone: - - - False - True - 0 - - - - - True - False - True - - - False - True - 1 - - + True + Region: - True - False + False + True 1 + + + True + False + True + + + False + True + 2 + + + + + True + False + Zone: + + + False + True + 3 + + + + + True + False + True + + + False + True + 4 + + False True - 2 + 3 @@ -3802,7 +3846,7 @@ agreement False True - 3 + 4 @@ -3821,13 +3865,22 @@ agreement none 35.299999237060547 - + True - False False - vertical - + + True + False + False + vertical + + + + + + -1 +