Commit 507f1cc6 authored by Marinus Schraal's avatar Marinus Schraal

searchbar: Add a ui file for DropDown

parent ae7f3aaf
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="DropDown" parent="GtkRevealer">
<property name="halign">center</property>
<property name="valign">start</property>
<property name="visible">True</property>
<child>
<object class="GtkFrame">
<property name="opacity">0.9</property>
<property name="shadow-type">in</property>
<property name="visible">True</property>
<child>
<object class="GtkGrid" id="_grid">
<property name="orientation">horizontal</property>
<property name="visible">True</property>
</object>
</child>
</object>
</child>
</template>
</interface>
......@@ -11,6 +11,7 @@
<file preprocess="xml-stripblanks">ArtistAlbumWidget.ui</file>
<file preprocess="xml-stripblanks">ArtistAlbumsWidget.ui</file>
<file preprocess="xml-stripblanks">DiscBox.ui</file>
<file preprocess="xml-stripblanks">DropDown.ui</file>
<file preprocess="xml-stripblanks">EmptyView.ui</file>
<file preprocess="xml-stripblanks">PlayerToolbar.ui</file>
<file preprocess="xml-stripblanks">Searchbar.ui</file>
......
......@@ -236,30 +236,29 @@ class FilterView(Gtk.TreeView):
additional_func(col, cell, model, _iter)
@Gtk.Template(resource_path="/org/gnome/Music/DropDown.ui")
class DropDown(Gtk.Revealer):
"""Dropdown source/option selection widget for search
Shows available search sources and their respective options and
allows selection.
"""
__gtype_name__ = 'DropDown'
_grid = Gtk.Template.Child()
def __repr__(self):
return '<DropDown>'
@log
def __init__(self):
super().__init__(halign=Gtk.Align.CENTER, valign=Gtk.Align.START)
super().__init__()
self._source_manager = None
self.search_manager = None
self._search_filter = None
self._grid = Gtk.Grid(orientation=Gtk.Orientation.HORIZONTAL)
frame = Gtk.Frame(shadow_type=Gtk.ShadowType.IN, opacity=0.9)
frame.get_style_context().add_class('documents-dropdown')
frame.add(self._grid)
frame.show_all()
self.add(frame)
self.show()
@log
def initialize_filters(self, searchbar):
self._source_manager = SourceManager(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment