Skip to content

Commit

Permalink
feat: Use AdwEntryRow for MPV player input, add popover for display…
Browse files Browse the repository at this point in the history
…ing help/subtitle instead of using the subtitle directly

Signed-off-by: Felicitas Pojtinger <[email protected]>
  • Loading branch information
pojntfx committed Jul 18, 2024
1 parent 98e69d4 commit 979ed32
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
4 changes: 2 additions & 2 deletions internal/components/main_menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func AddMainMenu(
gateway *server.Gateway,
getMagnetLink func() string,
cancel func(),
) (*adw.PreferencesDialog, *gtk.Entry) {
) (*adw.PreferencesDialog, *adw.EntryRow) {
menuBuilder := gtk.NewBuilderFromResource(resources.GResourceMenuPath)
menu := menuBuilder.GetObject("main-menu").Cast().(*gio.Menu)

Expand All @@ -39,7 +39,7 @@ func AddMainMenu(
preferencesBuilder := gtk.NewBuilderFromResource(resources.GResourcePreferencesPath)
preferencesDialog := preferencesBuilder.GetObject("preferences-dialog").Cast().(*adw.PreferencesDialog)
storageLocationInput := preferencesBuilder.GetObject("storage-location-input").Cast().(*gtk.Button)
mpvCommandInput := preferencesBuilder.GetObject("mpv-command-input").Cast().(*gtk.Entry)
mpvCommandInput := preferencesBuilder.GetObject("mpv-command-input").Cast().(*adw.EntryRow)
verbosityLevelInput := preferencesBuilder.GetObject("verbosity-level-input").Cast().(*adw.SpinRow)
remoteGatewaySwitchInput := preferencesBuilder.GetObject("htorrent-remote-gateway-switch").Cast().(*gtk.Switch)
remoteGatewayURLInput := preferencesBuilder.GetObject("htorrent-url-input").Cast().(*gtk.Entry)
Expand Down
23 changes: 19 additions & 4 deletions internal/resources/preferences.ui
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,20 @@
</child>

<child>
<object class="AdwActionRow">
<object class="AdwEntryRow" id="mpv-command-input">
<property name="title" translatable="yes">Player command</property>
<property name="subtitle" translatable="yes">Command to launch mpv with</property>
<property name="activatable-widget">mpv-command-input</property>

<child>
<object class="GtkEntry" id="mpv-command-input">
<object class="GtkMenuButton">
<style>
<class name="flat"></class>
<class name="circular"></class>
</style>

<property name="icon-name">help-about</property>
<property name="tooltip-text">Show help</property>
<property name="valign">center</property>
<property name="popover">mpv-command-input-help-popover</property>
</object>
</child>
</object>
Expand Down Expand Up @@ -205,4 +211,13 @@
</object>
</child>
</object>


<object class="GtkPopover" id="mpv-command-input-help-popover">
<child>
<object class="GtkLabel">
<property name="label">Command to launch mpv with</property>
</object>
</child>
</object>
</interface>

0 comments on commit 979ed32

Please sign in to comment.