mirror of
https://github.com/morgan9e/warehouse
synced 2026-04-14 00:04:08 +09:00
Window size is now remembered
This commit is contained in:
@@ -53,11 +53,11 @@ flatpak run io.github.flattool.Warehouse
|
||||
- [x] +Display dependent runtimes in app properties
|
||||
- [ ] +Filter by runtimes
|
||||
- [x] +Indicate apps & runtimes that are EOL
|
||||
- [x] Remember window size
|
||||
|
||||
[ * = Needed before new release, + = New feature, ! = Bug fix ]
|
||||
## Ideas that might get added but no promise of happening
|
||||
- Installing new apps via ID match
|
||||
- Remember window size
|
||||
- Pin / unpin runtimes and apps
|
||||
- Option to uninstall apps when removing a remote
|
||||
- Make refreshing the main list after install and uninstall happen in a thread
|
||||
@@ -1,5 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<schemalist gettext-domain="warehouse">
|
||||
<schema id="io.github.flattool.Warehouse" path="/io/github/flattool/Warehouse/">
|
||||
<key name="window-width" type="i">
|
||||
<default>800</default>
|
||||
<summary>Window Width</summary>
|
||||
<description>The width of the main window</description>
|
||||
</key>
|
||||
<key name="window-height" type="i">
|
||||
<default>500</default>
|
||||
<summary>Window Height</summary>
|
||||
<description>The height of the main window</description>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
||||
|
||||
@@ -2,8 +2,8 @@ using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template WarehouseWindow : Adw.ApplicationWindow {
|
||||
default-width: 800;
|
||||
default-height: 500;
|
||||
// default-width: 800;
|
||||
// default-height: 500;
|
||||
|
||||
Adw.ToolbarView main_toolbar_view {
|
||||
[top]
|
||||
|
||||
@@ -510,12 +510,23 @@ class WarehouseWindow(Adw.ApplicationWindow):
|
||||
self.windowSetEmpty(True)
|
||||
self.filter_button.set_sensitive(True)
|
||||
|
||||
def loadSettings(self):
|
||||
width = self.settings.get_int("window-width")
|
||||
height = self.settings.get_int("window-height")
|
||||
self.set_default_size(width, height)
|
||||
|
||||
def saveSettings(self, _a):
|
||||
self.settings.set_int("window-width", self.get_allocated_width())
|
||||
self.settings.set_int("window-height", self.get_allocated_height())
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self.my_utils = myUtils(self)
|
||||
self.filter_list = [True, False, ["all"], ["all"]]
|
||||
self.host_flatpaks = self.my_utils.getHostFlatpaks()
|
||||
self.set_size_request(0, 230)
|
||||
self.settings = Gio.Settings.new("io.github.flattool.Warehouse")
|
||||
self.loadSettings()
|
||||
|
||||
if self.host_flatpaks == [['']]:
|
||||
self.windowSetEmpty(True)
|
||||
@@ -542,5 +553,7 @@ class WarehouseWindow(Adw.ApplicationWindow):
|
||||
|
||||
self.filter_button.connect("toggled", self.filterWindowHandler)
|
||||
|
||||
self.connect("close-request", self.saveSettings)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user