mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
tweak button layout again
This commit is contained in:
parent
e0582dee2f
commit
6bab81c180
2 changed files with 84 additions and 63 deletions
|
@ -43,24 +43,29 @@ class GroupManager(QDialog):
|
|||
self.reload()
|
||||
# config tree
|
||||
h = self.form.tree.header()
|
||||
h.setResizeMode(QHeaderView.ResizeToContents)
|
||||
h.setResizeMode(0, QHeaderView.Stretch)
|
||||
#h.setResizeMode(QHeaderView.ResizeToContents)
|
||||
h.setResizeMode(COLNAME, QHeaderView.Stretch)
|
||||
h.setResizeMode(COLOPTS, QHeaderView.ResizeToContents)
|
||||
h.setResizeMode(COLCHECK, QHeaderView.ResizeToContents)
|
||||
h.resizeSection(COLCOUNT, 70)
|
||||
h.resizeSection(COLDUE, 70)
|
||||
h.resizeSection(COLNEW, 70)
|
||||
h.setMovable(False)
|
||||
self.form.tree.setIndentation(15)
|
||||
|
||||
def addButtons(self):
|
||||
box = self.form.buttonBox2
|
||||
def button(name, func, type=QDialogButtonBox.ActionRole):
|
||||
b = box.addButton(name, type)
|
||||
b.connect(b, SIGNAL("clicked()"), func)
|
||||
return b
|
||||
box = self.form.buttonBox
|
||||
def button(w, func):
|
||||
w.connect(w, SIGNAL("clicked()"), func)
|
||||
return w
|
||||
f = self.form
|
||||
# selection
|
||||
button(_("Select &All"), self.onSelectAll).setShortcut("a")
|
||||
button(_("Select &None"), self.onSelectNone).setShortcut("n")
|
||||
b = button(_("&Options..."), self.onEdit).setShortcut("o")
|
||||
button(_("&Rename..."), self.onRename).setShortcut("r")
|
||||
button(_("&Delete"), self.onDelete)
|
||||
self.connect(self.form.buttonBox1,
|
||||
button(f.selAll, self.onSelectAll).setShortcut("a")
|
||||
button(f.selNone, self.onSelectNone).setShortcut("n")
|
||||
button(f.opts, self.onEdit).setShortcut("o")
|
||||
button(f.rename, self.onRename).setShortcut("r")
|
||||
button(f.delete_2, self.onDelete)
|
||||
self.connect(self.form.buttonBox,
|
||||
SIGNAL("helpRequested()"),
|
||||
lambda: aqt.openHelp("GroupManager"))
|
||||
|
||||
|
@ -179,6 +184,8 @@ class GroupManager(QDialog):
|
|||
branch.setText(COLCOUNT, str(grp[2]))
|
||||
branch.setText(COLDUE, str(grp[3]))
|
||||
branch.setText(COLNEW, str(grp[4]))
|
||||
for i in (COLCOUNT, COLDUE, COLNEW):
|
||||
branch.setTextAlignment(i, Qt.AlignRight)
|
||||
self.groupMap[grp[0]] = grp[1]
|
||||
self.fullNames[grp[0]] = head+grp[0]
|
||||
if grp[1]:
|
||||
|
|
|
@ -16,6 +16,12 @@
|
|||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="tree">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>10</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
@ -32,7 +38,7 @@
|
|||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Options</string>
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
|
@ -58,57 +64,65 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox2">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::NoButton</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox1">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="selAll">
|
||||
<property name="text">
|
||||
<string>Select &All</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="rename">
|
||||
<property name="text">
|
||||
<string>&Rename...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="selNone">
|
||||
<property name="text">
|
||||
<string>Select &None</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="delete_2">
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="opts">
|
||||
<property name="text">
|
||||
<string>&Settings...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3" rowspan="2">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>tree</tabstop>
|
||||
<tabstop>selAll</tabstop>
|
||||
<tabstop>selNone</tabstop>
|
||||
<tabstop>rename</tabstop>
|
||||
<tabstop>delete_2</tabstop>
|
||||
<tabstop>opts</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox1</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox1</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
Loading…
Reference in a new issue