Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lots of browser padding issues #4066

Merged
merged 3 commits into from Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Run tests
shell: msys2 {0}
run: |
MSYSTEM= python3 -R -bb setup.py test
MSYSTEM= python3 -R -bb setup.py test --no-quality

flatpak:
runs-on: ubuntu-20.04
Expand Down
13 changes: 7 additions & 6 deletions quodlibet/browsers/albums/main.py
@@ -1,6 +1,6 @@
# Copyright 2004-2007 Joe Wreschnig, Michael Urman, Iñigo Serna
# 2009-2010 Steven Robertson
# 2012-2021 Nick Boultbee
# 2012-2022 Nick Boultbee
# 2009-2014 Christoph Reiter
# 2018-2020 Uriel Zajaczkovski
# 2019 Ruud van Asseldonk
Expand Down Expand Up @@ -37,7 +37,7 @@
from quodlibet.qltk.searchbar import SearchBarBox
from quodlibet.qltk.songsmenu import SongsMenu
from quodlibet.qltk.views import AllTreeView
from quodlibet.qltk.x import MenuItem, Align, ScrolledWindow, RadioMenuItem
from quodlibet.qltk.x import MenuItem, ScrolledWindow, RadioMenuItem
from quodlibet.qltk.x import SymbolicIconImage
from quodlibet.query import Query
from quodlibet.util import connect_obj, DeferredSignal
Expand Down Expand Up @@ -232,8 +232,7 @@ def __init__(self, browser, model):

menu = Gtk.Menu()

sort_item = Gtk.MenuItem(
label=_(u"Sort _by…"), use_underline=True)
sort_item = Gtk.MenuItem(label=_(u"Sort _by…"), use_underline=True)
sort_menu = Gtk.Menu()

active = config.getint('browsers', 'album_sort', 1)
Expand Down Expand Up @@ -264,7 +263,7 @@ def __init__(self, browser, model):
SymbolicIconImage(Icons.EMBLEM_SYSTEM, Gtk.IconSize.MENU),
arrow=True)
button.set_menu(menu)
self.pack_start(button, True, True, 0)
self.pack_start(button, False, False, 0)

def __sort_toggled_cb(self, item, model, num):
if item.get_active():
Expand Down Expand Up @@ -589,7 +588,9 @@ def cell_data(column, cell, model, iter_, data):

prefs = PreferencesButton(self, model_sort)
search.pack_start(prefs, False, True, 0)
self.pack_start(Align(search, left=6, top=6), False, True, 0)
hb = Gtk.Box(spacing=3)
hb.pack_start(search, True, True, 6)
self.pack_start(hb, False, True, 0)
self.pack_start(sw, True, True, 0)

self.connect("destroy", self.__destroy)
Expand Down
4 changes: 2 additions & 2 deletions quodlibet/browsers/collection/main.py
@@ -1,6 +1,6 @@
# Copyright 2010, 2012-2014 Christoph Reiter
# 2017 Uriel Zajaczkovski
# 2017-2018 Nick Boultbee
# 2017-2022 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -241,7 +241,7 @@ def cell_data_pb(column, cell, model, iter_, data):
hbox.pack_start(search, True, True, 0)
hbox.pack_start(prefs, False, True, 0)

self.pack_start(Align(hbox, left=6, top=6), False, True, 0)
self.pack_start(Align(hbox, left=6, top=0), False, True, 0)
self.pack_start(sw, True, True, 0)

view.get_selection().set_mode(Gtk.SelectionMode.MULTIPLE)
Expand Down
4 changes: 2 additions & 2 deletions quodlibet/browsers/covergrid/main.py
@@ -1,6 +1,6 @@
# Copyright 2004-2007 Joe Wreschnig, Michael Urman, Iñigo Serna
# 2009-2010 Steven Robertson
# 2012-2021 Nick Boultbee
# 2012-2022 Nick Boultbee
# 2009-2014 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -332,7 +332,7 @@ def cell_data(view, cell, model, iter_, data):

prefs = PreferencesButton(self, model_sort)
search.pack_start(prefs, False, True, 0)
self.pack_start(Align(search, left=6, top=6), False, True, 0)
self.pack_start(Align(search, left=6, top=0), False, True, 0)
self.pack_start(sw, True, True, 0)

self.connect("destroy", self.__destroy)
Expand Down
2 changes: 1 addition & 1 deletion quodlibet/browsers/iradio.py
Expand Up @@ -648,7 +648,7 @@ def search_func(model, column, key, iter, data):
box = Gtk.HBox(spacing=6)
box.pack_start(search, True, True, 0)
box.pack_start(button, False, True, 0)
self._searchbox = Align(box, left=0, right=6, top=6)
self._searchbox = Align(box, left=0, right=6, top=0)
self._searchbox.show_all()

def qbar_response(infobar, response_id):
Expand Down
4 changes: 2 additions & 2 deletions quodlibet/browsers/paned/main.py
@@ -1,7 +1,7 @@
# Copyright 2004-2008 Joe Wreschnig, Michael Urman, Iñigo Serna
# 2009,2010 Steven Robertson
# 2009-2013 Christoph Reiter
# 2011-2018 Nick Boultbee
# 2011-2022 Nick Boultbee
# 2017 Fredrik Strupe
#
# This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -84,7 +84,7 @@ def __init__(self, library):
sbb.connect('key-press-event', self.__sb_key_pressed)
self._sb_box = sbb

align = Align(sbb, left=6, right=6, top=6)
align = Align(sbb, left=6, right=6, top=0)
self.pack_start(align, False, True, 0)

keyval, mod = Gtk.accelerator_parse("<Primary>Home")
Expand Down
4 changes: 2 additions & 2 deletions quodlibet/browsers/playlists/main.py
@@ -1,5 +1,5 @@
# Copyright 2005 Joe Wreschnig
# 2012 - 2021 Nick Boultbee
# 2011-2022 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -108,7 +108,7 @@ def _destroy(self, _browser):
def pack(self, songpane):
self._main_box.pack1(self, True, False)
self._rh_box = rhbox = Gtk.VBox(spacing=6)
align = Align(self._sb_box, left=0, right=6, top=6)
align = Align(self._sb_box, left=0, right=6, top=0)
rhbox.pack_start(align, False, True, 0)
rhbox.pack_start(songpane, True, True, 0)
self._main_box.pack2(rhbox, True, False)
Expand Down
8 changes: 4 additions & 4 deletions quodlibet/browsers/soundcloud/main.py
Expand Up @@ -115,9 +115,9 @@ def __init__(self, library):
else State.LOGGED_OUT)
self._create_searchbar(self.library)
vbox = Gtk.VBox()
vbox.pack_start(self._create_footer(), False, False, 6)
vbox.pack_start(self._create_header(), False, False, 0)
vbox.pack_start(self._create_category_widget(), True, True, 0)
vbox.pack_start(self.create_login_button(), False, False, 6)
vbox.pack_start(self.create_login_button(), False, False, 0)
vbox.show()
pane = qltk.ConfigRHPaned("browsers", "soundcloud_pos", 0.4)
pane.show()
Expand All @@ -136,7 +136,7 @@ def Menu(self, songs, library, items):
def online(self):
return self.api_client.online

def _create_footer(self):
def _create_header(self):
hbox = Gtk.HBox()
button = Gtk.Button(always_show_image=True, relief=Gtk.ReliefStyle.NONE)
button.connect('clicked', lambda _: website(SITE_URL))
Expand All @@ -160,7 +160,7 @@ def focus(widget, *args):
qltk.get_top_parent(widget).songlist.grab_focus()
search.connect('focus-out', focus)

self._searchbox = Align(search, left=0, right=6, top=6)
self._searchbox = Align(search, left=0, right=6, top=0)
self._searchbox.show_all()

def update_connect_button(self):
Expand Down
9 changes: 4 additions & 5 deletions quodlibet/browsers/tracks.py
@@ -1,4 +1,4 @@
# Copyright 2004-2020 Joe Wreschnig, Michael Urman, Iñigo Serna,
# Copyright 2004-2022 Joe Wreschnig, Michael Urman, Iñigo Serna,
# Christoph Reiter, Steven Robertson, Nick Boultbee,
# 2018-2019 Peter Strulo
#
Expand All @@ -18,7 +18,7 @@
from quodlibet.qltk.menubutton import MenuButton
from quodlibet.qltk.searchbar import MultiSearchBarBox
from quodlibet.qltk.songlist import SongList
from quodlibet.qltk.x import SymbolicIconImage
from quodlibet.qltk.x import SymbolicIconImage, Align
from quodlibet.qltk import Icons


Expand Down Expand Up @@ -64,8 +64,7 @@ def unpack(self, container, songpane):
container.remove(self)

def __init__(self, library):
super().__init__(margin=6, spacing=6,
orientation=Gtk.Orientation.VERTICAL)
super().__init__(spacing=6, orientation=Gtk.Orientation.VERTICAL)

self._query = None
self._library = library
Expand All @@ -87,7 +86,7 @@ def __init__(self, library):
prefs = PreferencesButton(sbb)
sbb.pack_start(prefs, False, True, 0)

self.pack_start(sbb, False, True, 0)
self.pack_start(Align(sbb, left=6, right=6), False, True, 0)
self.pack_start(sbb.flow_box, False, True, 0)
self.connect('destroy', self.__destroy)
self.show_all()
Expand Down
10 changes: 5 additions & 5 deletions quodlibet/qltk/quodlibetwindow.py
@@ -1,6 +1,6 @@
# Copyright 2004-2005 Joe Wreschnig, Michael Urman, Iñigo Serna
# 2012 Christoph Reiter
# 2012-2017 Nick Boultbee
# 2012-2022 Nick Boultbee
# 2017 Uriel Zajaczkovski
#
# This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -277,12 +277,12 @@ def __init__(self, parent, player, library):
info_item.add(box)
qltk.add_css(self, "GtkToolbar {padding: 3px;}")

self._pattern_box = Gtk.VBox()
self._pattern_box = Gtk.VBox(spacing=3)

# song text
info_pattern_path = os.path.join(quodlibet.get_user_dir(), "songinfo")
text = SongInfo(library.librarian, player, info_pattern_path)
self._pattern_box.pack_start(Align(text, border=3), True, True, 0)
self._pattern_box.pack_start(text, True, True, 0)
box.pack_start(self._pattern_box, True, True, 0)

# cover image
Expand All @@ -295,7 +295,7 @@ def __init__(self, parent, player, library):
app.cover_manager, 'cover-changed',
self.__song_art_changed, library)

box.pack_start(Align(self.image, border=2), False, True, 0)
box.pack_start(Align(self.image, top=3, right=3), False, True, 0)

# On older Gtk+ (3.4, at least)
# setting a margin on CoverImage leads to errors and result in the
Expand Down Expand Up @@ -600,7 +600,7 @@ def scroll_and_jump(*args):
main_box.pack_start(top_bar, False, True, 0)
self.top_bar = top_bar

self.__browserbox = Align(bottom=3)
self.__browserbox = Align(top=3, bottom=3)
self.__paned = paned = ConfigRHPaned("memory", "sidebar_pos", 0.25)
paned.pack1(self.__browserbox, resize=True)
# We'll pack2 when necessary (when the first sidebar plugin is set up)
Expand Down