fixup! Port UI to GTK 4

This commit is contained in:
coderkun 2023-11-26 18:10:43 +01:00
commit 3ee0ee73d5
6 changed files with 82 additions and 112 deletions

View file

@ -49,5 +49,12 @@ actionbar {
}
gridview child {
padding: 10px;
padding: 1px;
}
gridview.selection child {
opacity: 0.5;
}
gridview.selection child:hover,
gridview.selection child:selected {
opacity: 1;
}

View file

@ -12,9 +12,7 @@
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Select multiple albums</property>
<!--
<signal name="toggled" handler="on_select_toggled" swapped="no"/>
-->
<child>
<object class="GtkImage">
<property name="icon-name">object-select-symbolic</property>
@ -28,9 +26,7 @@
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Clear the playlist</property>
<!--
<signal name="clicked" handler="on_clear_clicked" swapped="no"/>
-->
<child>
<object class="GtkImage">
<property name="visible">True</property>
@ -43,7 +39,7 @@
</object>
<template class="McgPlaylistPanel" parent="AdwBin">
<child>
<object class="GtkStack">
<object class="GtkStack" id="playlist_stack">
<property name="transition-type">slide-left-right</property>
<child>
<object class="GtkBox" id="panel_normal">
@ -54,14 +50,8 @@
<child>
<object class="GtkGridView" id="playlist_grid">
<property name="orientation">vertical</property>
<!--
<property name="item-padding">0</property>
-->
<property name="single-click-activate">true</property>
<signal name="activate" handler="on_playlist_grid_clicked"/>
<!--
<signal name="selection-changed" handler="on_playlist_grid_selection_changed" swapped="no"/>
-->
<style>
<class name="no-bg"/>
</style>
@ -112,22 +102,18 @@
<property name="transition-type">slide-up</property>
<child>
<object class="GtkActionBar" id="actionbar">
<child>
<child type="end">
<object class="GtkButton">
<property name="label" translatable="yes">cancel</property>
<property name="receives-default">True</property>
<!--
<signal name="clicked" handler="on_selection_cancel_clicked" swapped="no"/>
-->
</object>
</child>
<child>
<child type="end">
<object class="GtkButton">
<property name="label" translatable="yes">remove</property>
<property name="receives-default">True</property>
<!--
<signal name="clicked" handler="on_selection_remove_clicked" swapped="no"/>
-->
</object>
</child>
</object>
@ -141,6 +127,7 @@
<property name="orientation">vertical</property>
<child>
<object class="GtkStack" id="standalone_stack">
<property name="vexpand">true</property>
<child>
<object class="GtkSpinner" id="standalone_spinner">
<property name="visible">True</property>
@ -153,9 +140,6 @@
<property name="can-focus">True</property>
<property name="kinetic-scrolling">False</property>
<property name="overlay-scrolling">False</property>
<!--
<signal name="size-allocate" handler="on_standalone_scroll_size_allocate" swapped="no"/>
-->
<child>
<object class="GtkViewport">
<property name="visible">True</property>
@ -163,9 +147,7 @@
<child>
<object class="GtkImage" id="standalone_image">
<property name="icon-name">gtk-missing-image</property>
<!--
<property name="icon_size">6</property>
-->
<property name="icon-size">large</property>
</object>
</child>
</object>
@ -176,22 +158,18 @@
</child>
<child>
<object class="GtkActionBar" id="actionbar_standalone">
<child>
<child type="end">
<object class="GtkButton">
<property name="label" translatable="yes">remove</property>
<property name="receives-default">True</property>
<!--
<signal name="clicked" handler="on_standalone_remove_clicked" swapped="no"/>
-->
</object>
</child>
<child>
<child type="end">
<object class="GtkButton">
<property name="label" translatable="yes">play</property>
<property name="receives-default">True</property>
<!--
<signal name="clicked" handler="on_standalone_play_clicked" swapped="no"/>
-->
</object>
</child>
</object>

View file

@ -4,9 +4,8 @@
<requires lib="adw" version="1.2" />
<template class="McgAppWindow" parent="AdwApplicationWindow">
<property name="content">
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="AdwToolbarView" id="toolbar_view">
<child type="top">
<object class="AdwHeaderBar" id="headerbar">
<property name="centering-policy">strict</property>
<property name="show_end_title_buttons">true</property>
@ -44,30 +43,35 @@
</child>
</object>
</child>
<child>
<object class="AdwToastOverlay" id="info_toast">
<property name="content">
<object class="GtkBox" id="content_box">
<property name="orientation">vertical</property>
<child>
<object class="GtkStack" id="content_stack">
<property name="name">content_stack</property>
<property name="vexpand">true</property>
<object class="AdwToastOverlay" id="info_toast">
<child>
<object class="AdwViewStack" id="panel_stack">
<object class="GtkStack" id="content_stack">
<property name="name">content_stack</property>
<property name="vexpand">true</property>
<signal name="notify::visible-child" handler="on_stack_switched" swapped="no"/>
<child>
<object class="AdwViewStack" id="panel_stack">
<property name="vexpand">true</property>
<signal name="notify::visible-child" handler="on_stack_switched" swapped="no"/>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="AdwViewSwitcherBar">
<property name="stack">panel_stack</property>
<binding name="reveal">
<lookup name="title-visible">headerbar_panel_switcher</lookup>
</binding>
</object>
</child>
</object>
</child>
<child>
<object class="AdwViewSwitcherBar">
<property name="stack">panel_stack</property>
<binding name="reveal">
<lookup name="title-visible">headerbar_panel_switcher</lookup>
</binding>
</object>
</child>
</property>
</object>
</property>
</template>