Compare commits
5 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 099adbab8c | |||
| 3d91ab1b35 | |||
| dce1c441a0 | |||
| cd4f32e7f2 | |||
| 79b3111fb0 |
6 changed files with 37 additions and 16 deletions
|
|
@ -36,7 +36,7 @@ For testing the application and running it without (system-wide) installation,
|
|||
donwload/clone the code, build it with the `--prefix` option and install it
|
||||
with `ninja`:
|
||||
|
||||
$ meson --prefix $(pwd)/install build
|
||||
$ meson setup --prefix $(pwd)/install build
|
||||
$ ninja -C build
|
||||
$ ninja -C build install
|
||||
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@
|
|||
<child>
|
||||
<object class="GtkScale" id="songs_scale">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">fill</property>
|
||||
<property name="vexpand">true</property>
|
||||
<property name="restrict-to-fill-level">False</property>
|
||||
|
|
@ -158,4 +159,3 @@
|
|||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
project('mcg',
|
||||
version: '4.0',
|
||||
version: '4.0.1',
|
||||
meson_version: '>= 0.59.0',
|
||||
default_options: [
|
||||
'warning_level=2',
|
||||
|
|
|
|||
|
|
@ -180,6 +180,21 @@ class CoverPanel(Gtk.Overlay):
|
|||
length, Gtk.PositionType.RIGHT,
|
||||
"{0[0]:02d}:{0[1]:02d} minutes".format(divmod(length, 60)))
|
||||
|
||||
# Align marks
|
||||
self._align_songs_scale_marks()
|
||||
|
||||
def _align_songs_scale_marks(self):
|
||||
self._align_songs_scale_mark(self.songs_scale)
|
||||
|
||||
def _align_songs_scale_mark(self, widget):
|
||||
child = widget.get_first_child()
|
||||
while child:
|
||||
if type(child) is Gtk.Label:
|
||||
child.set_halign(Gtk.Align.START)
|
||||
else:
|
||||
self._align_songs_scale_mark(child)
|
||||
child = child.get_next_sibling()
|
||||
|
||||
def _enable_tracklist(self):
|
||||
if self._current_album:
|
||||
# enable
|
||||
|
|
|
|||
|
|
@ -361,6 +361,7 @@ class LibraryPanel(Adw.Bin):
|
|||
self._library_lock.release()
|
||||
GObject.idle_add(self.stack.set_visible_child, self.scroll)
|
||||
self._sort_grid_model()
|
||||
GObject.idle_add(self.library_grid.scroll_to, 0, Gtk.ListScrollFlags.NONE, None)
|
||||
|
||||
def _set_widget_grid_size(self, grid_widget, size, vertical):
|
||||
self._library_stop.set()
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ class Window(Adw.ApplicationWindow):
|
|||
self._setting_volume = False
|
||||
self._headerbar_connection_button_active = True
|
||||
self._headerbar_playpause_button_active = True
|
||||
self._width = 0
|
||||
self._height = 0
|
||||
|
||||
# Help/Shortcuts dialog
|
||||
self.set_help_overlay(ShortcutsDialog())
|
||||
|
|
@ -144,8 +146,6 @@ class Window(Adw.ApplicationWindow):
|
|||
self._settings.get_boolean(Window.SETTING_SORT_TYPE))
|
||||
|
||||
# Signals
|
||||
self.connect("notify::default-width", self.on_resize)
|
||||
self.connect("notify::default-height", self.on_resize)
|
||||
self.connect("notify::maximized", self.on_maximized)
|
||||
self.connect("notify::fullscreened", self.on_fullscreened)
|
||||
self._connection_panel.connect(
|
||||
|
|
@ -258,6 +258,22 @@ class Window(Adw.ApplicationWindow):
|
|||
self.on_menu_search_library)
|
||||
self.add_action(self._search_library_action)
|
||||
|
||||
def do_size_allocate(self, width, height, baseline):
|
||||
Gtk.ApplicationWindow().do_size_allocate(self, width, height, baseline)
|
||||
|
||||
if self._width == width and self._height == height:
|
||||
return
|
||||
self._width = width
|
||||
self._height = height
|
||||
|
||||
if width > 0:
|
||||
self._cover_panel.set_width(width)
|
||||
if not self._state.get_property(WindowState.PROP_MAXIMIZED):
|
||||
self._state.set_property(WindowState.PROP_WIDTH, width)
|
||||
self._state.set_property(WindowState.PROP_HEIGHT, height)
|
||||
GObject.idle_add(self._playlist_panel.set_size, width, height)
|
||||
GObject.idle_add(self._library_panel.set_size, width, height)
|
||||
|
||||
# Menu callbacks
|
||||
|
||||
def on_menu_connect(self, action, value):
|
||||
|
|
@ -287,17 +303,6 @@ class Window(Adw.ApplicationWindow):
|
|||
|
||||
# Window callbacks
|
||||
|
||||
def on_resize(self, widget, event):
|
||||
width = self.get_size(Gtk.Orientation.HORIZONTAL)
|
||||
height = self.get_size(Gtk.Orientation.VERTICAL)
|
||||
if width > 0:
|
||||
self._cover_panel.set_width(width)
|
||||
if not self._state.get_property(WindowState.PROP_MAXIMIZED):
|
||||
self._state.set_property(WindowState.PROP_WIDTH, width)
|
||||
self._state.set_property(WindowState.PROP_HEIGHT, height)
|
||||
GObject.idle_add(self._playlist_panel.set_size, width, height)
|
||||
GObject.idle_add(self._library_panel.set_size, width, height)
|
||||
|
||||
def on_maximized(self, widget, maximized):
|
||||
self._state.set_property(WindowState.PROP_MAXIMIZED, maximized is True)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue