mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2025-01-22 07:21:13 +00:00
Make the GTK update dialog wider
gtk_window_set_default_size() has no effect when the dialog is marked as non-resizable with gtk_window_set_resizable(), so the minimum size is instead achieved by setting a minimum width on the progress bar.
This commit is contained in:
parent
c253cecfa6
commit
2c70cebd05
1 changed files with 9 additions and 1 deletions
|
@ -44,9 +44,9 @@ void UpdateDialogGtk::init(int argc, char** argv)
|
||||||
|
|
||||||
m_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
m_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||||
gtk_window_set_title(GTK_WINDOW(m_window),AppInfo::name().c_str());
|
gtk_window_set_title(GTK_WINDOW(m_window),AppInfo::name().c_str());
|
||||||
gtk_window_set_resizable(GTK_WINDOW(m_window),false);
|
|
||||||
|
|
||||||
m_progressLabel = gtk_label_new("Installing Updates");
|
m_progressLabel = gtk_label_new("Installing Updates");
|
||||||
|
|
||||||
GtkWidget* windowLayout = gtk_vbox_new(FALSE,3);
|
GtkWidget* windowLayout = gtk_vbox_new(FALSE,3);
|
||||||
GtkWidget* buttonLayout = gtk_hbox_new(FALSE,3);
|
GtkWidget* buttonLayout = gtk_hbox_new(FALSE,3);
|
||||||
GtkWidget* labelLayout = gtk_hbox_new(FALSE,3);
|
GtkWidget* labelLayout = gtk_hbox_new(FALSE,3);
|
||||||
|
@ -56,6 +56,12 @@ void UpdateDialogGtk::init(int argc, char** argv)
|
||||||
|
|
||||||
m_progressBar = gtk_progress_bar_new();
|
m_progressBar = gtk_progress_bar_new();
|
||||||
|
|
||||||
|
// give the dialog a sensible default size by setting a minimum
|
||||||
|
// width on the progress bar. This is used instead of setting
|
||||||
|
// a default size for the dialog since gtk_window_set_default_size()
|
||||||
|
// is ignored when a dialog is marked as non-resizable
|
||||||
|
gtk_widget_set_usize(m_progressBar,350,-1);
|
||||||
|
|
||||||
gtk_signal_connect(GTK_OBJECT(m_finishButton),"clicked",
|
gtk_signal_connect(GTK_OBJECT(m_finishButton),"clicked",
|
||||||
GTK_SIGNAL_FUNC(UpdateDialogGtk::finish),this);
|
GTK_SIGNAL_FUNC(UpdateDialogGtk::finish),this);
|
||||||
|
|
||||||
|
@ -77,7 +83,9 @@ void UpdateDialogGtk::init(int argc, char** argv)
|
||||||
gtk_widget_show(m_finishButton);
|
gtk_widget_show(m_finishButton);
|
||||||
gtk_widget_show(m_progressBar);
|
gtk_widget_show(m_progressBar);
|
||||||
|
|
||||||
|
gtk_window_set_resizable(GTK_WINDOW(m_window),false);
|
||||||
gtk_window_set_position(GTK_WINDOW(m_window),GTK_WIN_POS_CENTER);
|
gtk_window_set_position(GTK_WINDOW(m_window),GTK_WIN_POS_CENTER);
|
||||||
|
|
||||||
gtk_widget_show(m_window);
|
gtk_widget_show(m_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue