Align query editing box with relation viewer

Not sure of what the problem was, probably some layout or frame that
had spacing.

Replaced the whole mess with a stacked widget instead.

close #8
master
Salvo 'LtWorf' Tomaselli 2015-11-20 17:06:59 +07:00
parent cd6bd42a2b
commit be8230d54a
2 changed files with 237 additions and 283 deletions

@ -87,9 +87,11 @@ class relForm(QtWidgets.QMainWindow):
def setMultiline(self, multiline):
self.multiline = multiline
self.settings.setValue('multiline', multiline)
self.ui.lineExpressionFrame.setVisible(not multiline)
self.ui.frmOptimizations.setVisible(not multiline)
self.ui.frmMultiLine.setVisible(multiline)
if multiline:
index = 0
else:
index = 1
self.ui.stackedWidget.setCurrentIndex(index)
self.ui.actionMulti_line_mode.setChecked(multiline)
def load_query(self, *index):

@ -80,115 +80,15 @@
</property>
</column>
</widget>
<widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item>
<widget class="QFrame" name="frmOptimizations">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<widget class="QStackedWidget" name="stackedWidget">
<property name="lineWidth">
<number>0</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>3</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<property name="leftMargin">
<property name="currentIndex">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QListWidget" name="lstHistory">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>60</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QPushButton" name="cmdOptimize">
<property name="text">
<string>Optimize</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cmdUndoOptimize">
<property name="text">
<string>Undo optimize</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cmdClearHistory">
<property name="text">
<string>Clear history</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="frmMultiLine">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<widget class="QWidget" name="multiline">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
@ -242,7 +142,7 @@
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>3</number>
</property>
@ -262,45 +162,104 @@
<bool>false</bool>
</property>
<property name="default">
<bool>false</bool>
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QFrame" name="lineExpressionFrame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="single_line">
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>3</number>
<number>2</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>5</number>
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>5</number>
<number>0</number>
</property>
<item>
<widget class="QListWidget" name="lstHistory">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>60</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="spacing">
<number>1</number>
</property>
<item>
<widget class="QPushButton" name="cmdOptimize">
<property name="text">
<string>Optimize</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cmdUndoOptimize">
<property name="text">
<string>Undo optimize</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cmdClearHistory">
<property name="text">
<string>Clear history</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="txtResult">
@ -364,6 +323,10 @@
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</widget>
</item>
</layout>
@ -373,8 +336,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>637</width>
<height>18</height>
<width>644</width>
<height>27</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@ -404,7 +367,7 @@
</widget>
<widget class="QMenu" name="menuSettings">
<property name="title">
<string>Settings</string>
<string>Setti&amp;ngs</string>
</property>
<addaction name="actionMulti_line_mode"/>
</widget>
@ -421,7 +384,7 @@
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Operators</string>
<string>&amp;Operators</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
@ -831,7 +794,7 @@
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Attributes</string>
<string>Attrib&amp;utes</string>
</property>
<attribute name="dockWidgetArea">
<number>2</number>
@ -892,7 +855,7 @@
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Relations</string>
<string>Re&amp;lations</string>
</property>
<attribute name="dockWidgetArea">
<number>2</number>
@ -998,7 +961,7 @@
<property name="minimumSize">
<size>
<width>99</width>
<height>89</height>
<height>101</height>
</size>
</property>
<property name="features">
@ -1008,7 +971,7 @@
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Menu</string>
<string>&amp;Menu</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
@ -1084,12 +1047,12 @@
</action>
<action name="actionCheck_for_new_versions">
<property name="text">
<string>Check for new versions</string>
<string>&amp;Check for new versions</string>
</property>
</action>
<action name="actionNew_relation">
<property name="text">
<string>New relation</string>
<string>&amp;New relation</string>
</property>
<property name="shortcut">
<string>Ctrl+N</string>
@ -1097,7 +1060,7 @@
</action>
<action name="actionEdit_relation">
<property name="text">
<string>Edit relation</string>
<string>&amp;Edit relation</string>
</property>
<property name="shortcut">
<string>Ctrl+E</string>
@ -1123,7 +1086,7 @@
</action>
<action name="actionUnload_relation">
<property name="text">
<string>Unload relation</string>
<string>&amp;Unload relation</string>
</property>
</action>
<action name="actionMulti_line_mode">
@ -1131,7 +1094,7 @@
<bool>true</bool>
</property>
<property name="text">
<string>Multi-line mode</string>
<string>&amp;Multi-line mode</string>
</property>
<property name="shortcut">
<string>Ctrl+L</string>
@ -1140,17 +1103,6 @@
</widget>
<tabstops>
<tabstop>table</tabstop>
<tabstop>lstHistory</tabstop>
<tabstop>cmdOptimize</tabstop>
<tabstop>cmdUndoOptimize</tabstop>
<tabstop>cmdClearHistory</tabstop>
<tabstop>txtMultiQuery</tabstop>
<tabstop>cmdClearMultilineQuery</tabstop>
<tabstop>cmdExecuteMultiline</tabstop>
<tabstop>txtResult</tabstop>
<tabstop>txtQuery</tabstop>
<tabstop>cmdClearQuery</tabstop>
<tabstop>cmdExecute</tabstop>
<tabstop>cmdProduct</tabstop>
<tabstop>cmdDifference</tabstop>
<tabstop>cmdUnion</tabstop>