49
49
let w_list = this.get_windows ();
50
50
if (w_list.length) {
51
51
w_list[0].present ();
52
w_list[0].move (this.settings.get_setting ("ui.x").data,
53
this.settings.get_setting ("ui.y").data);
52
if (!(this._is_shown ())) {
53
if (!(this.settings.get_setting ("ui.x").data < 0 &&
54
this.settings.get_setting ("ui.y").data < 0)){
55
this.window.move (this.settings.get_setting ("ui.x").data,
56
this.settings.get_setting ("ui.y").data);
144
149
/* * Hide the window so, so we can show it later */
145
150
this.window.connect ('delete_event',
146
151
Lang.bind (this, function () {
147
print ("balls to it!");
148
152
this._save_settings ();
150
/* To Prevent the widow from rely being destroyed? */
153
this.window.hide_on_delete ();
154
156
this.add_window (this.window);
200
202
let preferences_action = new Gio.SimpleAction ({name: "preferences"});
201
203
preferences_action.connect ('activate', Lang.bind (this, function (){
202
let pref_dialog = new PreferencesUI.PreferencesUI ({
203
transient_for: this.window
204
let pref_dialog = new PreferencesUI.PreferencesUI ();
205
pref_dialog.set_transient_for (this.window);
205
206
pref_dialog.run ();
207
208
this.add_action (preferences_action);
214
215
_prepare_header_bar: function () {
216
this.headerbar.pack_start ((this.new_post_btn = new Gtk.Button ({
217
let button_container = new Gtk.Box ({orientation: Gtk.Orientation.HORIZONTAL});
219
button_container.pack_start ((this.new_post_btn = new Gtk.Button ({
217
220
image: (new Gtk.Image ({icon_name: 'text-editor-symbolic'})),
218
221
tooltip_text: _("Create new post"),
221
this.new_post_btn.get_style_context ().add_class ("image-button");
223
this.headerbar.pack_start ((this.refresh_btn = new Gtk.Button({
222
})), false, false, null);
224
button_container.pack_start ((this.refresh_btn = new Gtk.Button({
224
225
image: (new Gtk.Image ({icon_name: 'emblem-synchronizing-symbolic'})),
225
226
tooltip_text: _("Refresh the stream"),
228
this.refresh_btn.get_style_context ().add_class ("image-button");
227
})), false, false, null);
229
let special_btn_container_style_ctx = button_container.get_style_context ();
230
special_btn_container_style_ctx.add_class ("linked");
232
this.headerbar.pack_start (button_container);
230
234
this.headerbar.pack_end ((this.user_menu_btn = new UserButton.UserButton ({
231
235
image: (new Gtk.Image ({icon_name: 'mail-send-symbolic'})),
244
248
this.settings.set_setting ("ui.x", win_pos[0]);
245
249
this.settings.set_setting ("ui.y", win_pos[1]);
246
250
this.settings.commit_to_file ();
253
_is_shown: function () {
254
let win_pos = this.window.get_position ();
255
if (win_pos[0] == undefined || win_pos[1] == undefined) {