@@ -65,6 +65,9 @@ struct _Imagewindow {
6565 GFile * load_folder ;
6666
6767 GtkWidget * right_click_menu ;
68+ GtkWidget * prev ;
69+ GtkWidget * next ;
70+ GtkWidget * refresh ;
6871 GtkWidget * title ;
6972 GtkWidget * subtitle ;
7073 GtkWidget * gears ;
@@ -753,6 +756,11 @@ imagewindow_imageui_set_visible(Imagewindow *win,
753756
754757 // update the menus
755758 imagewindow_tilesource_changed (new_tilesource , win );
759+
760+ // update sensitivity of titlebar buttons
761+ gtk_widget_set_sensitive (win -> prev , win -> n_files > 1 );
762+ gtk_widget_set_sensitive (win -> next , win -> n_files > 1 );
763+ gtk_widget_set_sensitive (win -> refresh , win -> n_files > 0 );
756764}
757765
758766static void
@@ -1616,10 +1624,6 @@ imagewindow_error_clicked(GtkWidget *button, Imagewindow *win)
16161624 imagewindow_error_hide (win );
16171625}
16181626
1619- #define BIND (field ) \
1620- gtk_widget_class_bind_template_child(GTK_WIDGET_CLASS(class), \
1621- Imagewindow, field);
1622-
16231627static void
16241628imagewindow_class_init (ImagewindowClass * class )
16251629{
@@ -1628,20 +1632,23 @@ imagewindow_class_init(ImagewindowClass *class)
16281632 gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (class ),
16291633 APP_PATH "/imagewindow.ui" );
16301634
1631- BIND (right_click_menu );
1632- BIND (title );
1633- BIND (subtitle );
1634- BIND (gears );
1635- BIND (progress_bar );
1636- BIND (progress );
1637- BIND (progress_cancel );
1638- BIND (error_bar );
1639- BIND (error_label );
1640- BIND (main_box );
1641- BIND (stack );
1642- BIND (properties );
1643- BIND (display_bar );
1644- BIND (info_bar );
1635+ BIND_VARIABLE (Imagewindow , right_click_menu );
1636+ BIND_VARIABLE (Imagewindow , prev );
1637+ BIND_VARIABLE (Imagewindow , next );
1638+ BIND_VARIABLE (Imagewindow , refresh );
1639+ BIND_VARIABLE (Imagewindow , title );
1640+ BIND_VARIABLE (Imagewindow , subtitle );
1641+ BIND_VARIABLE (Imagewindow , gears );
1642+ BIND_VARIABLE (Imagewindow , progress_bar );
1643+ BIND_VARIABLE (Imagewindow , progress );
1644+ BIND_VARIABLE (Imagewindow , progress_cancel );
1645+ BIND_VARIABLE (Imagewindow , error_bar );
1646+ BIND_VARIABLE (Imagewindow , error_label );
1647+ BIND_VARIABLE (Imagewindow , main_box );
1648+ BIND_VARIABLE (Imagewindow , stack );
1649+ BIND_VARIABLE (Imagewindow , properties );
1650+ BIND_VARIABLE (Imagewindow , display_bar );
1651+ BIND_VARIABLE (Imagewindow , info_bar );
16451652
16461653 BIND_CALLBACK (imagewindow_pressed_cb );
16471654 BIND_CALLBACK (imagewindow_error_clicked );
0 commit comments