Verified Commit a3f0d07e authored by Todd Weaver's avatar Todd Weaver
Browse files

Switching to flowbox, removing excess gtkboxes, connected button signals,...

Switching to flowbox, removing excess gtkboxes, connected button signals, standardized on default gtk styling (mostly)
parent f8750b0f
......@@ -15,8 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import GLib, Gtk, Gdk
......@@ -29,15 +27,43 @@ Handy.init()
class ResultsBox(Gtk.Box):
__gtype_name__ = 'ResultsBox'
play = Gtk.Template.Child()
pause = Gtk.Template.Child()
def __init__(self, **kwargs):
super().__init__(**kwargs)
logging.info('made it to results.py')
print("made it!")
provider = Gtk.CssProvider()
provider.load_from_resource('/sm/puri/Stream/stream.css')
provider.load_from_resource('/sm/puri/Stream/ui/results.css')
styleContext = Gtk.StyleContext()
styleContext.add_provider_for_screen(
Gdk.Screen.get_default(), provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
@Gtk.Template.Callback()
def audio_dl_button(self, button):
print("audio_dl_button")
@Gtk.Template.Callback()
def video_dl_button(self, button):
print("video_dl_button")
@Gtk.Template.Callback()
def play_button(self, button):
self.play.set_visible(False)
self.pause.set_visible(True)
print("play_button")
@Gtk.Template.Callback()
def pause_button(self, button):
self.play.set_visible(True)
self.pause.set_visible(False)
print("pause_button")
@Gtk.Template.Callback()
def speed_button(self, button):
print("speed_button")
@Gtk.Template.Callback()
def fullscreen_button(self, button):
print("fullscreen_button")
.fillwidth {
/* border: 1px solid blue; */
}
row {
/* border: 1px solid red; */
}
button.rounded-button {
padding: 4px;
border-radius: 9999px;
-gtk-outline-radius: 9999px;
min-width: 24px;
min-height: 24px;
}
button.large {
padding: 12px;
}
list row label.title {
font-weight: bold;
}
list row label.subtitle {
font-size: smaller;
}
list row {
margin-top: 0;
margin-bottom: 0;
border-radius: 0;
}
list row:first-child {
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
list row:last-child {
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
}
list row.expanded {
margin-top: 10px;
margin-bottom: 10px;
border-radius: 8px;
border-bottom-width: 1px;
transition: 250ms all linear;
}
list row.expanded-before {
border-bottom-width: 1px;
border-bottom-right-radius: 8px;
border-bottom-left-radius: 8px;
transition: 250ms all linear;
}
list row.expanded-after {
border-top-right-radius: 8px;
border-top-left-radius: 8px;
transition: 250ms all linear;
}
list row:first-child.expanded {
margin-top:0;
}
list row:last-child.expanded {
margin-bottom: 0;
}
......@@ -3,8 +3,8 @@
<gresource prefix="/sm/puri/Stream">
<file>ui/window.ui</file>
<file>ui/results.ui</file>
<file>stream.css</file>
<file>ui/video-placeholder.svg</file>
<file preprocess="xml-stripblanks" alias="gtk/help-overlay.ui">ui/help-overlay.ui</file>
<file>ui/results.css</file>
<file>ui/video-placeholder-332x186.png</file>
<file alias="gtk/help-overlay.ui">ui/help-overlay.ui</file>
</gresource>
</gresources>
......@@ -8,7 +8,6 @@
<property name="section-name">shortcuts</property>
<property name="max-height">10</property>
<child>
<object class="GtkShortcutsGroup">
<property name="visible">1</property>
<property name="title" translatable="yes" context="shortcut window">General</property>
......
.results {
border: 1px solid gray;
margin: 6px;
padding: 6px;
padding-bottom: 12px;
border-radius: 8px;
border-bottom-width: 1px;
transition: 250ms all linear;
background-color: white;
}
.videoframe {
border: 1px solid black;
}
button.rounded-button {
padding: 4px;
border-radius: 9999px;
-gtk-outline-radius: 9999px;
min-width: 24px;
min-height: 24px;
}
button.large {
padding: 12px;
}
This diff is collapsed.
......@@ -25,7 +25,7 @@
<child>
<object class="GtkToggleButton" id="search_button">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Search</property>
<property name="valign">center</property>
......@@ -84,6 +84,7 @@
<object class="GtkSearchEntry" id="search_entry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="has-focus">True</property>
<property name="primary-icon-name">edit-find-symbolic</property>
<property name="primary-icon-activatable">False</property>
<property name="primary-icon-sensitive">False</property>
......@@ -103,7 +104,7 @@
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
......@@ -117,23 +118,19 @@
</child>
<child>
<object class="GtkScrolledWindow" id="results_window">
<property name="can-focus">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="hscrollbar-policy">never</property>
<child>
<object class="HdyClamp" id="column">
<object class="GtkFlowBox" id="results_list">
<property name="can-focus">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="maximum_size">640</property>
<child>
<object class="GtkListBox" id="results_list">
<property name="can-focus">False</property>
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
</child>
<property name="hexpand">True</property>
<property name="homogeneous">True</property>
<property name="max-children-per-line">5</property>
<property name="selection-mode">none</property>
<property name="activate-on-single-click">False</property>
</object>
</child>
</object>
......
......@@ -59,3 +59,11 @@ class StreamWindow(Handy.ApplicationWindow):
self.search_button.connect("clicked", self.search_button_cb)
self.search_entry.connect("changed", self.search_entry_cb, self.search_entry)
def play_button(self, button):
logging.error('play_button')
print("play_button it!")
def pause_button(self, button):
logging.error('pause_button')
print("pause_button it!")
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