Fix for #172: Configuration window hides add/remove buttons by default

merge-requests/218/head
Jens Lody 8 years ago
parent fda6424226
commit 706cbcefc9
  1. 18
      data/weather-settings.ui
  2. 26
      src/prefs.js

@ -352,20 +352,6 @@
</row>
</data>
</object>
<object class="GtkScrolledWindow" id="main-widget">
<property name="width_request">775</property>
<property name="height_request">480</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">20</property>
<child>
<object class="GtkViewport" id="scrolled-viewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hscroll_policy">natural</property>
<property name="vscroll_policy">natural</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkNotebook" id="prefs-notebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
@ -1350,8 +1336,4 @@ See the &lt;a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html"&gt;G
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>

@ -119,26 +119,7 @@ const WeatherPrefsWidget = new GObject.Class({
this.initWindow();
defaultSize = this.MainWidget.get_size_request();
var borderWidth = this.MainWidget.get_border_width();
defaultSize[0] += 2 * borderWidth;
defaultSize[1] += 2 * borderWidth;
this.MainWidget.set_size_request(-1, -1);
this.MainWidget.set_border_width(0);
this.refreshUI();
this.add(this.MainWidget);
this.MainWidget.connect('realize', Lang.bind(this, function() {
if (inRealize)
return;
inRealize = true;
this.MainWidget.get_toplevel().resize(defaultSize[0], defaultSize[1]);
inRealize = false;
}));
},
Window: new Gtk.Builder(),
@ -148,7 +129,7 @@ const WeatherPrefsWidget = new GObject.Class({
this.Window.add_from_file(EXTENSIONDIR + "/weather-settings.ui");
this.MainWidget = this.Window.get_object("main-widget");
this.mainWidget = this.Window.get_object("prefs-notebook");
this.treeview = this.Window.get_object("tree-treeview");
this.liststore = this.Window.get_object("tree-liststore");
this.editWidget = this.Window.get_object("edit-widget");
@ -497,7 +478,7 @@ const WeatherPrefsWidget = new GObject.Class({
},
refreshUI: function() {
this.MainWidget = this.Window.get_object("main-widget");
this.mainWidget = this.Window.get_object("prefs-notebook");
this.treeview = this.Window.get_object("tree-treeview");
this.liststore = this.Window.get_object("tree-liststore");
@ -1093,7 +1074,8 @@ function init() {
}
function buildPrefsWidget() {
let widget = new WeatherPrefsWidget();
let prefs = new WeatherPrefsWidget();
let widget = prefs.mainWidget;
widget.show_all();
return widget;
}

Loading…
Cancel
Save