diff --git a/source/ubl-settings-update.c b/source/ubl-settings-update.c index e31e9bd..a1efdb3 100644 --- a/source/ubl-settings-update.c +++ b/source/ubl-settings-update.c @@ -600,6 +600,16 @@ void on_web_publish_add(GtkWidget *,main_window *widgets){ g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_web_publish_accept),dict); } +void on_scrolled_window_size_allocate(GtkWidget *, GdkRectangle *allocation, repo_add_window *window){ + if (allocation->height<100){ + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(gtk_widget_get_parent(gtk_widget_get_parent(window->SourceListBox))),GTK_POLICY_NEVER,GTK_POLICY_NEVER); + gtk_widget_set_size_request(gtk_widget_get_parent(gtk_widget_get_parent(window->SourceListBox)),-1,allocation->height); + } else { + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(gtk_widget_get_parent(gtk_widget_get_parent(window->SourceListBox))),GTK_POLICY_NEVER,GTK_POLICY_ALWAYS); + gtk_widget_set_size_request(gtk_widget_get_parent(gtk_widget_get_parent(window->SourceListBox)),-1,100); + } +} + void on_repo_add(GtkWidget *, main_window *widgets){ gtk_tree_selection_unselect_all(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MirrorTree))); repo_add_window *window = yon_repo_add_window_new(); @@ -1359,6 +1369,7 @@ repo_add_window *yon_repo_add_window_new(){ window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton"); window->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel"); window->SourceBox = yon_gtk_builder_get_widget(builder,"SourceBox"); + window->SourceListBox = yon_gtk_builder_get_widget(builder,"SourceListBox"); window->RepoSourceAddButton = yon_gtk_builder_get_widget(builder,"RepoSourceAddButton"); window->NeverRadio = yon_gtk_builder_get_widget(builder,"NeverRadio"); window->OptionalRadio = yon_gtk_builder_get_widget(builder,"OptionalRadio"); @@ -1384,6 +1395,7 @@ repo_add_window *yon_repo_add_window_new(){ g_signal_connect(G_OBJECT(window->UsageDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->UsageEnableSearchCheck); g_signal_connect(G_OBJECT(window->UsageDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->UsageEnableUpdateCheck); g_signal_connect(G_OBJECT(window->UsageDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->UsageSysupgradeCheck); + g_signal_connect(G_OBJECT(window->SourceListBox),"size-allocate",G_CALLBACK(on_scrolled_window_size_allocate),window); gtk_widget_show(window->Window); return window; diff --git a/source/ubl-settings-update.h b/source/ubl-settings-update.h index f2cc8c6..8031568 100644 --- a/source/ubl-settings-update.h +++ b/source/ubl-settings-update.h @@ -152,6 +152,7 @@ typedef struct { GtkWidget *UsageEnableSearchCheck; GtkWidget *UsageEnableUpdateCheck; GtkWidget *UsageDefaultCheck; + GtkWidget *SourceListBox; GtkWidget *RepoSignConditionCombo; GtkWidget *RepoSignCheckCombo; GtkWidget *RepoSourceButton; @@ -311,6 +312,8 @@ void on_password_accept(); void on_password_open(GtkWidget *, web_publication_add_window *window); +void on_scrolled_window_size_allocate(GtkWidget *, GdkRectangle *allocation, repo_add_window *window); + password_window *yon_password_window_new(); repo_add_window *yon_repo_add_window_new(); web_publication_add_window *yon_web_publication_add_window_new(); diff --git a/ubl-settings-update-repo-add.glade b/ubl-settings-update-repo-add.glade index 85357fb..e006d8b 100644 --- a/ubl-settings-update-repo-add.glade +++ b/ubl-settings-update-repo-add.glade @@ -234,13 +234,14 @@ Configuration - configuration path True True - 100 + 0 + 100 True False - + True False 5