mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 23:42: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):
|
def setupMappingFrame(self):
|
||||||
# qt seems to have a bug with adding/removing from a grid, so we add
|
# qt seems to have a bug with adding/removing from a grid, so we add
|
||||||
# to a separate object and add/remove that instead
|
# 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
|
self.mapwidget = None
|
||||||
|
|
||||||
def hideMapping(self):
|
def hideMapping(self):
|
||||||
|
@ -262,8 +265,8 @@ you can enter it here. Use \\t to represent tab."""),
|
||||||
self.mapbox.addWidget(self.mapwidget)
|
self.mapbox.addWidget(self.mapwidget)
|
||||||
self.grid = QGridLayout(self.mapwidget)
|
self.grid = QGridLayout(self.mapwidget)
|
||||||
self.mapwidget.setLayout(self.grid)
|
self.mapwidget.setLayout(self.grid)
|
||||||
self.grid.setMargin(6)
|
self.grid.setMargin(3)
|
||||||
self.grid.setSpacing(12)
|
self.grid.setSpacing(6)
|
||||||
fields = self.importer.fields()
|
fields = self.importer.fields()
|
||||||
for num in range(len(self.mapping)):
|
for num in range(len(self.mapping)):
|
||||||
text = _("Field <b>%d</b> of file is:") % (num + 1)
|
text = _("Field <b>%d</b> of file is:") % (num + 1)
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>440</width>
|
<width>527</width>
|
||||||
<height>513</height>
|
<height>430</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="mappingGroup">
|
<widget class="QGroupBox" name="mappingGroup">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -59,22 +59,6 @@
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<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">
|
<item row="0" column="1">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
|
@ -93,6 +77,38 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</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>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
Loading…
Reference in a new issue