Procházet zdrojové kódy

ui: Add button with camera status.

Pavel Machek před 2 měsíci
rodič
revize
9e4b760b77
2 změnil soubory, kde provedl 14 přidání a 0 odebrání
  1. 9 0
      data/camera.ui
  2. 5 0
      src/main.c

+ 9 - 0
data/camera.ui

@@ -87,6 +87,15 @@
                             </style>
                           </object>
                         </child>
+                        <child>
+                          <object class="GtkButton" id="status-button">
+                            <property name="valign">start</property>
+                            <style>
+                              <class name="flat"/>
+                              <class name="control"/>
+                            </style>
+                          </object>
+                        </child>
                       </object>
                     </child>
                     <child>

+ 5 - 0
src/main.c

@@ -72,6 +72,7 @@ GtkWidget *iso_button;
 GtkWidget *shutter_button;
 GtkWidget *focus_button;
 GtkWidget *flash_button;
+GtkWidget *status_button;
 
 LfbEvent *capture_event;
 static GtkWidget *movie;
@@ -234,6 +235,8 @@ update_state(const mp_state_main *new_state)
         // Even if there's no flash led/v4l, it'll just default to using the screen
         // as flash, so always enable this button
         gtk_widget_set_visible(flash_button, true);
+        gtk_widget_set_visible(status_button, true);
+        gtk_button_set_label(GTK_BUTTON(status_button), "(st)");
 
         return false;
 }
@@ -1316,6 +1319,8 @@ activate(GtkApplication *app, gpointer data)
                 GTK_WIDGET(gtk_builder_get_object(builder, "focus-controls-button"));
         flash_button =
                 GTK_WIDGET(gtk_builder_get_object(builder, "flash-controls-button"));
+        status_button =
+                GTK_WIDGET(gtk_builder_get_object(builder, "status-button"));
         GtkWidget *setting_dng_button =
                 GTK_WIDGET(gtk_builder_get_object(builder, "setting-raw"));
         GtkWidget *setting_postprocessor_combo =