Skip to content

Commit

Permalink
Add scan button to start page
Browse files Browse the repository at this point in the history
Closes #57
  • Loading branch information
swsnr committed Dec 22, 2024
1 parent c57fcb5 commit 5dad179
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 17 deletions.
2 changes: 2 additions & 0 deletions resources/de.swsnr.turnon.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<release version="next" date="9999-01-01">
<description>
<p>Add a toolbar button to enable or disable network scanning.</p>
<p>Add a button to enable network scanning to the start page.</p>
<p>When network scanning is enabled show devices from the system's ARP cache.</p>
<p>Add a button to directly add devices discovered from network scanning.</p>
<p>Improve app icon contrast on dark backgrounds.</p>
Expand All @@ -42,6 +43,7 @@
<issue url="https://github.com/swsnr/turnon/issues/4">GH-4</issue>
<issue url="https://github.com/swsnr/turnon/issues/50">GH-50</issue>
<issue url="https://github.com/swsnr/turnon/pull/54">GH-54</issue>
<issue url="https://github.com/swsnr/turnon/issues/57">GH-57</issue>
</issues>
<url>https://github.com/swsnr/turnon/releases/tag/next</url>
</release>
Expand Down
39 changes: 30 additions & 9 deletions resources/ui/turnon-application-window.blp
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,36 @@ template $TurnOnApplicationWindow: Adw.ApplicationWindow {
icon-name: bind template.startpage-icon-name;
vexpand: true;

child: Gtk.Button {
label: C_("application-window.status-page.button.label", "Add new device");
action-name: "win.add-device";
halign: center;

styles [
"pill",
"suggested-action"
]
styles [
"compact"
]

child: Adw.Clamp {
Gtk.Box {
orientation: vertical;
homogeneous: true;
halign: center;

Gtk.Button {
label: C_("application-window.status-page.button.label", "Add new device");
action-name: "win.add-device";

styles [
"pill",
"suggested-action"
]
}

Gtk.Button {
label: C_("application-window.status-page.button.label", "Scan network");
action-name: "win.toggle-scan-network";

styles [
"pill",
"suggested-action"
]
}
}
};
}
}
Expand Down
39 changes: 31 additions & 8 deletions resources/ui/turnon-application-window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,38 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
<property name="description" translatable="yes" context="application-window.status-page.description">Add a new device to turn it on.</property>
<property name="icon-name" bind-source="TurnOnApplicationWindow" bind-property="startpage-icon-name" bind-flags="sync-create"/>
<property name="vexpand">true</property>
<style>
<class name="compact"/>
</style>
<property name="child">
<object class="GtkButton">
<property name="label" translatable="yes" context="application-window.status-page.button.label">Add new device</property>
<property name="action-name">win.add-device</property>
<property name="halign">3</property>
<style>
<class name="pill"/>
<class name="suggested-action"/>
</style>
<object class="AdwClamp">
<child>
<object class="GtkBox">
<property name="orientation">1</property>
<property name="homogeneous">true</property>
<property name="halign">3</property>
<child>
<object class="GtkButton">
<property name="label" translatable="yes" context="application-window.status-page.button.label">Add new device</property>
<property name="action-name">win.add-device</property>
<style>
<class name="pill"/>
<class name="suggested-action"/>
</style>
</object>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes" context="application-window.status-page.button.label">Scan network</property>
<property name="action-name">win.toggle-scan-network</property>
<style>
<class name="pill"/>
<class name="suggested-action"/>
</style>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
Expand Down
Binary file modified screenshots/social-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/start-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5dad179

Please sign in to comment.