/gpump/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/gpump/trunk

« back to all changes in this revision

Viewing changes to src/app.js

  • Committer: Gustav Hartvigsson
  • Date: 2014-07-07 21:13:06 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20140707211306-4p11ub81j7aerw93
* bound the GtkSwitch for "use dark theme"
* bound the reset button for that setting
* bound the reset all button

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
    
76
76
    if (!(this.settings.get_setting ("ui.x").data < 0 &&
77
77
        this.settings.get_setting ("ui.y").data < 0)){
78
 
      this.window.move (this.settings.get_setting ("ui.x").data, this.settings.get_setting ("ui.y").data);
 
78
      this.window.move (this.settings.get_setting ("ui.x").data,
 
79
                                       this.settings.get_setting ("ui.y").data);
79
80
    }
80
81
    
 
82
    var gtk_settings = Gtk.Settings.get_default ();
 
83
      if ( this.settings.get_setting ("main.use_dark").data ) {
 
84
        gtk_settings["gtk_application_prefer_dark_theme"] = true;
 
85
      } else {
 
86
        gtk_settings["gtk_application_prefer_dark_theme"] = false;
 
87
      }
 
88
    
81
89
    print ("derp!\n");
82
90
    
83
91
    this.window.add (( this.scroll_view = new Gtk.ScrolledWindow () ));
110
118
    let about_action = new Gio.SimpleAction ({name: "about"});
111
119
    about_action.connect ('activate', Lang.bind (this, function () {
112
120
      let about_dialog = new Gtk.AboutDialog ({use_header_bar: true,
113
 
                                               transient_for: this.window,
114
 
                                               modal: true,
115
 
                                               version: "pre-alpha ~BZR~",
116
 
                                     program_name: GLib.get_application_name (),
117
 
                                 copyright: "Gustav \'Gego/XAREN\' Hartvigsson, 2014",
118
 
                                           license_type: Gtk.License.LGPL_3_0});
 
121
        transient_for: this.window,
 
122
        modal: true,
 
123
        version: "pre-alpha ~BZR~",
 
124
        program_name: GLib.get_application_name (),
 
125
        copyright: "Gustav \'Gego/XAREN\' Hartvigsson, 2014",
 
126
        license_type: Gtk.License.LGPL_3_0});
119
127
      
120
 
      about_dialog.authors = ["Gustav Hartvigsson <gustav.hartvigsson@gmail.com>"];
 
128
      about_dialog.authors =
 
129
                          ["Gustav Hartvigsson <gustav.hartvigsson@gmail.com>"];
121
130
      about_dialog.connect ("response", function () {
122
131
        about_dialog.destroy ();
123
132
      });
124
133
      about_dialog.run ();
125
 
    }))
 
134
    }));
126
135
    this.add_action (about_action);
127
136
    
128
137
    let quit_action = new Gio.SimpleAction ({name: "quit"});
145
154
      pref_dialog.set_transient_for (this.window);
146
155
      pref_dialog.run ();
147
156
    }));
148
 
    this.add_action (preferences_action)
 
157
    this.add_action (preferences_action);
149
158
  },
150
159
  
151
160
  /**