mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Restore visual order for layout buttons in the popup
This commit is contained in:
parent
6a7b721dd3
commit
257e8dba26
@ -8,7 +8,6 @@ from PyQt5.Qt import (
|
|||||||
QFontMetrics, QHBoxLayout, QIcon, QMenu, QPainter, QPushButton, QSize,
|
QFontMetrics, QHBoxLayout, QIcon, QMenu, QPainter, QPushButton, QSize,
|
||||||
QSizePolicy, Qt, QWidget, QStyleOption, QStyle)
|
QSizePolicy, Qt, QWidget, QStyleOption, QStyle)
|
||||||
|
|
||||||
from calibre.utils.icu import primary_sort_key
|
|
||||||
|
|
||||||
ICON_SZ = 64
|
ICON_SZ = 64
|
||||||
|
|
||||||
@ -99,8 +98,7 @@ class LayoutMenu(QMenu):
|
|||||||
b.setVisible(False), b.setCheckable(True), b.setChecked(b.text() in 'tags grid')
|
b.setVisible(False), b.setCheckable(True), b.setChecked(b.text() in 'tags grid')
|
||||||
b.label = b.text().capitalize()
|
b.label = b.text().capitalize()
|
||||||
else:
|
else:
|
||||||
buttons = sorted(
|
buttons = parent.layout_buttons
|
||||||
parent.layout_buttons, key=lambda b: primary_sort_key(b.label))
|
|
||||||
for b in buttons:
|
for b in buttons:
|
||||||
self.items.append(LayoutItem(b, self))
|
self.items.append(LayoutItem(b, self))
|
||||||
l.addWidget(self.items[-1])
|
l.addWidget(self.items[-1])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user