[gnome-music/wip/mschraal/gtk4: 57/81] searchview: Cleanup & disable some stuff
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/gtk4: 57/81] searchview: Cleanup & disable some stuff
- Date: Wed, 26 Feb 2020 15:15:21 +0000 (UTC)
commit e688b00b21954417da833292a71d5ddb96e60abd
Author: Marinus Schraal <mschraal gnome org>
Date: Thu Oct 31 16:02:37 2019 +0100
searchview: Cleanup & disable some stuff
data/ui/SearchView.ui | 101 ++++++++++++++++-------------------------
gnomemusic/views/searchview.py | 58 +++++++++++------------
2 files changed, 67 insertions(+), 92 deletions(-)
---
diff --git a/data/ui/SearchView.ui b/data/ui/SearchView.ui
index e67e85a7..98285125 100644
--- a/data/ui/SearchView.ui
+++ b/data/ui/SearchView.ui
@@ -2,47 +2,36 @@
<interface>
<requires lib="gtk+" version="3.18"/>
<object class="GtkImage" id="view_all_image_artist">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="icon_name">go-next-symbolic</property>
<property name="icon_size">1</property>
</object>
<object class="GtkImage" id="view_all_image_album">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="icon_name">go-next-symbolic</property>
<property name="icon_size">1</property>
</object>
<template class="SearchView" parent="GtkStack">
- <property name="visible">True</property>
<child>
<object class="GtkScrolledWindow" id="_search_results">
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="visible">True</property>
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
<child>
<object class="GtkBox" id="container">
- <property name="halign">fill</property>
- <property name="hexpand">True</property>
+ <property name="hexpand">1</property>
+<!--
<property name="margin-bottom">20</property>
<property name="margin-left">120</property>
<property name="margin-right">120</property>
<property name="margin-top">20</property>
+-->
<property name="orientation">vertical</property>
- <property name="visible">True</property>
<child>
<object class="GtkBox" id="_artist_header">
- <property name="halign">fill</property>
- <property name="hexpand">True</property>
- <property name="homogeneous">True</property>
- <property name="orientation">horizontal</property>
- <property name="visible">True</property>
+ <property name="hexpand">1</property>
+ <property name="homogeneous">1</property>
<child>
<object class="GtkLabel">
- <property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Artists</property>
- <property name="visible">True</property>
<style>
<class name="search-header"/>
</style>
@@ -52,11 +41,12 @@
<object class="GtkButton" id="_view_all_artists">
<property name="halign">end</property>
<property name="label" translatable="yes">View All</property>
+<!--
<property name="always_show_image">True</property>
<property name="image">view_all_image_artist</property>
<property name="image_position">right</property>
- <property name="visible">True</property>
<signal name="button-release-event" handler="_on_all_artists_clicked" swapped="no"/>
+-->
</object>
</child>
</object>
@@ -64,19 +54,17 @@
<child>
<object class="GtkFlowBox" id="_artist_flowbox">
<property name="column_spacing">6</property>
- <property name="halign">fill</property>
- <property name="hexpand">True</property>
- <property name="homogeneous">True</property>
+ <property name="hexpand">1</property>
+ <property name="homogeneous">1</property>
+<!--
<property name="margin-bottom">18</property>
- <property name="margin-end">0</property>
- <property name="margin-start">0</property>
<property name="margin-top">18</property>
+-->
<property name="max-children-per-line">6</property>
<property name="min-children-per-line">1</property>
<property name="row_spacing">12</property>
<property name="selection-mode">none</property>
<property name="valign">start</property>
- <property name="visible">True</property>
<signal name="child-activated" handler="_on_artist_activated" swapped="no"/>
<style>
<class name="content-view"/>
@@ -85,17 +73,12 @@
</child>
<child>
<object class="GtkBox" id="_album_header">
- <property name="halign">fill</property>
- <property name="hexpand">True</property>
- <property name="homogeneous">True</property>
- <property name="orientation">horizontal</property>
- <property name="visible">True</property>
+ <property name="hexpand">1</property>
+ <property name="homogeneous">1</property>
<child>
<object class="GtkLabel">
- <property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Albums</property>
- <property name="visible">True</property>
<style>
<class name="search-header"/>
</style>
@@ -105,31 +88,30 @@
<object class="GtkButton" id="_view_all_albums">
<property name="halign">end</property>
<property name="label" translatable="yes">View All</property>
+<!--
<property name="always_show_image">True</property>
<property name="image">view_all_image_album</property>
<property name="image_position">right</property>
- <property name="visible">True</property>
<signal name="button-release-event" handler="_on_all_albums_clicked" swapped="no"/>
+-->
</object>
</child>
</object>
</child>
<child>
<object class="GtkFlowBox" id="_album_flowbox">
- <property name="halign">fill</property>
- <property name="hexpand">True</property>
+ <property name="hexpand">1</property>
<property name="valign">start</property>
- <property name="homogeneous">True</property>
+ <property name="homogeneous">1</property>
<property name="min_children_per_line">1</property>
<property name="max_children_per_line">6</property>
+<!--
<property name="margin-bottom">18</property>
- <property name="margin-end">0</property>
- <property name="margin-start">0</property>
<property name="margin-top">18</property>
+-->
<property name="row_spacing">12</property>
<property name="column_spacing">6</property>
<property name="selection_mode">none</property>
- <property name="visible">True</property>
<signal name="child-activated" handler="_on_album_activated" swapped="no"/>
<style>
<class name="content-view"/>
@@ -138,17 +120,12 @@
</child>
<child>
<object class="GtkBox" id="_songs_header">
- <property name="halign">fill</property>
- <property name="hexpand">True</property>
- <property name="homogeneous">True</property>
- <property name="orientation">horizontal</property>
- <property name="visible">True</property>
+ <property name="hexpand">1</property>
+ <property name="homogeneous">1</property>
<child>
<object class="GtkLabel">
- <property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Songs</property>
- <property name="visible">True</property>
<style>
<class name="search-header"/>
</style>
@@ -158,8 +135,9 @@
</child>
<child>
<object class="GtkListBox" id="_songs_listbox">
+<!--
<property name="margin-top">20</property>
- <property name="visible">True</property>
+-->
<style>
<class name="songs-list"/>
</style>
@@ -171,25 +149,24 @@
</child>
<child>
<object class="GtkScrolledWindow" id="_all_search_results">
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="visible">True</property>
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
<child>
<object class="GtkBox">
- <property name="halign">fill</property>
- <property name="hexpand">True</property>
+ <property name="hexpand">1</property>
+<!--
<property name="margin-bottom">20</property>
<property name="margin-left">120</property>
<property name="margin-right">120</property>
<property name="margin-top">20</property>
+-->
<property name="orientation">vertical</property>
- <property name="visible">True</property>
<child>
<object class="GtkFlowBox" id="_artist_all_flowbox">
+ <property name="visible">0</property>
<property name="column_spacing">6</property>
- <property name="halign">fill</property>
- <property name="hexpand">True</property>
- <property name="homogeneous">True</property>
+ <property name="hexpand">1</property>
+ <property name="homogeneous">1</property>
<property name="margin">18</property>
<property name="max-children-per-line">6</property>
<property name="min-children-per-line">1</property>
@@ -204,17 +181,15 @@
</child>
<child>
<object class="GtkFlowBox" id="_album_all_flowbox">
- <property name="halign">fill</property>
- <property name="hexpand">True</property>
+ <property name="hexpand">1</property>
<property name="valign">start</property>
- <property name="homogeneous">True</property>
+ <property name="homogeneous">1</property>
<property name="min_children_per_line">1</property>
<property name="max_children_per_line">6</property>
<property name="margin">18</property>
<property name="row_spacing">12</property>
<property name="column_spacing">6</property>
<property name="selection_mode">none</property>
- <property name="visible">True</property>
<signal name="child-activated" handler="_on_album_activated" swapped="no"/>
<style>
<class name="content-view"/>
@@ -224,6 +199,6 @@
</object>
</child>
</object>
- </child>h
- </template>
- </interface>
+ </child>
+ </template>
+</interface>
diff --git a/gnomemusic/views/searchview.py b/gnomemusic/views/searchview.py
index 3d35bd20..df9df1e9 100644
--- a/gnomemusic/views/searchview.py
+++ b/gnomemusic/views/searchview.py
@@ -366,35 +366,35 @@ class SearchView(Gtk.Stack):
self.set_visible_child(self._scrolled_artist_window)
self.props.search_mode_active = False
- @Gtk.Template.Callback()
- def _on_all_artists_clicked(self, widget, event, user_data=None):
- self.props.state = SearchView.State.ALL_ARTISTS
- self._headerbar.props.state = HeaderBar.State.SEARCH
- self._headerbar.props.title = _("Artists Results")
- self._headerbar.props.subtitle = None
-
- self._artist_all_flowbox.props.visible = True
- self._album_all_flowbox.props.visible = False
- self._artist_all_flowbox.bind_model(
- self._artist_model, self._create_artist_widget)
-
- self.props.visible_child = self._all_search_results
- self.props.search_mode_active = False
-
- @Gtk.Template.Callback()
- def _on_all_albums_clicked(self, widget, event, user_data=None):
- self.props.state = SearchView.State.ALL_ALBUMS
- self._headerbar.props.state = HeaderBar.State.SEARCH
- self._headerbar.props.title = _("Albums Results")
- self._headerbar.props.subtitle = None
-
- self._artist_all_flowbox.props.visible = False
- self._album_all_flowbox.props.visible = True
- self._album_all_flowbox.bind_model(
- self._album_model, self._create_album_widget)
-
- self.props.visible_child = self._all_search_results
- self.props.search_mode_active = False
+ # @Gtk.Template.Callback()
+ # def _on_all_artists_clicked(self, widget, event, user_data=None):
+ # self.props.state = SearchView.State.ALL_ARTISTS
+ # self._headerbar.props.state = HeaderBar.State.SEARCH
+ # self._headerbar.props.title = _("Artists Results")
+ # self._headerbar.props.subtitle = None
+
+ # self._artist_all_flowbox.props.visible = True
+ # self._album_all_flowbox.props.visible = False
+ # self._artist_all_flowbox.bind_model(
+ # self._artist_model, self._create_artist_widget)
+
+ # self.props.visible_child = self._all_search_results
+ # self.props.search_mode_active = False
+
+ # @Gtk.Template.Callback()
+ # def _on_all_albums_clicked(self, widget, event, user_data=None):
+ # self.props.state = SearchView.State.ALL_ALBUMS
+ # self._headerbar.props.state = HeaderBar.State.SEARCH
+ # self._headerbar.props.title = _("Albums Results")
+ # self._headerbar.props.subtitle = None
+
+ # self._artist_all_flowbox.props.visible = False
+ # self._album_all_flowbox.props.visible = True
+ # self._album_all_flowbox.bind_model(
+ # self._album_model, self._create_album_widget)
+
+ # self.props.visible_child = self._all_search_results
+ # self.props.search_mode_active = False
def _select_all(self, value):
def child_select(child):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]