@@ -47,16 +47,10 @@ public class Camera.Widgets.HeaderBar : Gtk.HeaderBar {
47
47
}
48
48
" " " ;
49
49
50
- public Backend . Settings settings { private get ; construct; }
51
-
52
50
public signal void take_photo_clicked ();
53
51
public signal void start_recording_clicked ();
54
52
public signal void stop_recording_clicked ();
55
53
56
- public HeaderBar (Backend .Settings settings ) {
57
- Object (settings: settings);
58
- }
59
-
60
54
construct {
61
55
timer_button = new Widgets .TimerButton ();
62
56
@@ -104,10 +98,10 @@ public class Camera.Widgets.HeaderBar : Gtk.HeaderBar {
104
98
105
99
update_take_button_icon ();
106
100
107
- settings. action_type_changed . connect (update_take_button_icon);
101
+ Camera . Application . settings. changed . connect (update_take_button_icon);
108
102
109
103
take_button. clicked. connect (() = > {
110
- if (settings. get_action_type ( ) == Utils . ActionType . PHOTO ) {
104
+ if (Camera . Application . settings. get_enum ( " mode " ) == Utils . ActionType . PHOTO ) {
111
105
start_delay_time (timer_button. delay);
112
106
// Time to take a photo
113
107
Timeout . add_seconds (timer_button. delay, () = > {
@@ -126,9 +120,9 @@ public class Camera.Widgets.HeaderBar : Gtk.HeaderBar {
126
120
127
121
mode_switch. notify[" active" ]. connect (() = > {
128
122
if (mode_switch. active) {
129
- settings. set_action_type ( Utils . ActionType . VIDEO );
123
+ Camera . Application . settings. set_enum ( " mode " , Utils . ActionType . VIDEO );
130
124
} else {
131
- settings. set_action_type ( Utils . ActionType . PHOTO );
125
+ Camera . Application . settings. set_enum ( " mode " , Utils . ActionType . PHOTO );
132
126
}
133
127
});
134
128
@@ -157,7 +151,7 @@ public class Camera.Widgets.HeaderBar : Gtk.HeaderBar {
157
151
}
158
152
159
153
private void update_take_button_icon () {
160
- Utils . ActionType action_type = settings. get_action_type ( );
154
+ var action_type = ( Utils . ActionType ) Camera . Application . settings. get_enum ( " mode " );
161
155
162
156
if (action_type == Utils . ActionType . PHOTO ) {
163
157
take_image. icon_name = PHOTO_ICON_SYMBOLIC ;
0 commit comments