mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
make importing dialog scrollable
This commit is contained in:
parent
9b9bb4bd64
commit
f973dabb9a
2 changed files with 41 additions and 22 deletions
|
@ -224,7 +224,10 @@ you can enter it here. Use \\t to represent tab."""),
|
|||
def setupMappingFrame(self):
|
||||
# qt seems to have a bug with adding/removing from a grid, so we add
|
||||
# to a separate object and add/remove that instead
|
||||
self.mapbox = QVBoxLayout(self.dialog.mappingArea)
|
||||
self.frame = QFrame(self.dialog.mappingArea)
|
||||
self.dialog.mappingArea.setWidget(self.frame)
|
||||
self.mapbox = QVBoxLayout(self.frame)
|
||||
self.mapbox.setContentsMargins(0,0,0,0)
|
||||
self.mapwidget = None
|
||||
|
||||
def hideMapping(self):
|
||||
|
@ -262,8 +265,8 @@ you can enter it here. Use \\t to represent tab."""),
|
|||
self.mapbox.addWidget(self.mapwidget)
|
||||
self.grid = QGridLayout(self.mapwidget)
|
||||
self.mapwidget.setLayout(self.grid)
|
||||
self.grid.setMargin(6)
|
||||
self.grid.setSpacing(12)
|
||||
self.grid.setMargin(3)
|
||||
self.grid.setSpacing(6)
|
||||
fields = self.importer.fields()
|
||||
for num in range(len(self.mapping)):
|
||||
text = _("Field <b>%d</b> of file is:") % (num + 1)
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>440</width>
|
||||
<height>513</height>
|
||||
<width>527</width>
|
||||
<height>430</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -42,7 +42,7 @@
|
|||
<item>
|
||||
<widget class="QGroupBox" name="mappingGroup">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
@ -59,22 +59,6 @@
|
|||
</property>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="mappingArea">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
|
@ -93,6 +77,38 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QScrollArea" name="mappingArea">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>150</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>150</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
Loading…
Reference in a new issue