UI alignment changes

This commit is contained in:
Mohammed Nafees 2014-04-04 23:12:56 +05:30
parent 1ecdec7a5e
commit eae95a57b7
5 changed files with 81 additions and 54 deletions

View file

@ -162,51 +162,51 @@
<name>RunningScriptsWidget</name>
<message>
<location filename="ui/runningScriptsWidget.ui" line="14"/>
<location filename="../build/interface/ui_runningScriptsWidget.h" line="126"/>
<location filename="../build/interface/ui_runningScriptsWidget.h" line="138"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui/runningScriptsWidget.ui" line="38"/>
<location filename="../build/interface/ui_runningScriptsWidget.h" line="127"/>
<location filename="ui/runningScriptsWidget.ui" line="39"/>
<location filename="../build/interface/ui_runningScriptsWidget.h" line="139"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:18pt;&quot;&gt;Running Scripts&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui/runningScriptsWidget.ui" line="61"/>
<location filename="../build/interface/ui_runningScriptsWidget.h" line="128"/>
<location filename="ui/runningScriptsWidget.ui" line="63"/>
<location filename="../build/interface/ui_runningScriptsWidget.h" line="140"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Currently running&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui/runningScriptsWidget.ui" line="86"/>
<location filename="../build/interface/ui_runningScriptsWidget.h" line="129"/>
<location filename="ui/runningScriptsWidget.ui" line="88"/>
<location filename="../build/interface/ui_runningScriptsWidget.h" line="141"/>
<source>Reload all</source>
<oldsource>Reload All</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui/runningScriptsWidget.ui" line="112"/>
<location filename="../build/interface/ui_runningScriptsWidget.h" line="130"/>
<location filename="ui/runningScriptsWidget.ui" line="114"/>
<location filename="../build/interface/ui_runningScriptsWidget.h" line="142"/>
<source>Stop all</source>
<oldsource>Stop All</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui/runningScriptsWidget.ui" line="133"/>
<location filename="../build/interface/ui_runningScriptsWidget.h" line="131"/>
<location filename="ui/runningScriptsWidget.ui" line="135"/>
<location filename="../build/interface/ui_runningScriptsWidget.h" line="143"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Recently loaded&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui/runningScriptsWidget.ui" line="150"/>
<location filename="../build/interface/ui_runningScriptsWidget.h" line="132"/>
<location filename="ui/runningScriptsWidget.ui" line="152"/>
<location filename="../build/interface/ui_runningScriptsWidget.h" line="144"/>
<source>(click a script or use the 1-9 keys to load and run it)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="ui/runningScriptsWidget.ui" line="198"/>
<location filename="../build/interface/ui_runningScriptsWidget.h" line="134"/>
<location filename="ui/runningScriptsWidget.ui" line="200"/>
<location filename="../build/interface/ui_runningScriptsWidget.h" line="146"/>
<source>There are no scripts currently running.</source>
<translation type="unfinished"></translation>
</message>

View file

@ -3635,7 +3635,7 @@ void Application::toggleRunningScriptsWidget()
if (!_runningScriptsWidget->toggleViewAction()->isChecked()) {
_runningScriptsWidget->setGeometry(_window->geometry().topLeft().x(),
_window->geometry().topLeft().y(),
310, _window->height());
_runningScriptsWidget->width(), _window->height());
_runningScriptsWidget->toggleViewAction()->trigger();
_runningScriptsWidget->grabKeyboard();
_runningScriptsWidget->show();

View file

@ -27,7 +27,7 @@ RunningScriptsWidget::RunningScriptsWidget(QDockWidget *parent) :
_runningScriptsTable = new ScriptsTableWidget(ui->runningScriptsTableWidget);
_runningScriptsTable->setColumnCount(2);
_runningScriptsTable->setColumnWidth(0, 252);
_runningScriptsTable->setColumnWidth(0, 245);
_runningScriptsTable->setColumnWidth(1, 22);
connect(_runningScriptsTable, &QTableWidget::cellClicked, this, &RunningScriptsWidget::stopScript);
@ -73,6 +73,21 @@ void RunningScriptsWidget::setRunningScripts(const QStringList& list)
_runningScriptsTable->setItem(i, 1, closeIcon);
}
int y = ui->runningScriptsTableWidget->y() + 12;
for (int i = 0; i < _runningScriptsTable->rowCount(); ++i) {
y += _runningScriptsTable->rowHeight(i);
}
ui->runningScriptsTableWidget->resize(ui->runningScriptsTableWidget->width(), y - 12);
_runningScriptsTable->resize(_runningScriptsTable->width(), y - 12);
ui->reloadAllButton->move(ui->reloadAllButton->x(), y);
ui->stopAllButton->move(ui->stopAllButton->x(), y);
ui->recentlyLoadedLabel->move(ui->recentlyLoadedLabel->x(),
ui->stopAllButton->y() + ui->stopAllButton->height() + 61);
ui->recentlyLoadedScriptsTableWidget->move(ui->recentlyLoadedScriptsTableWidget->x(),
ui->recentlyLoadedLabel->y() + 19);
createRecentlyLoadedScriptsTable();
}
@ -143,18 +158,18 @@ void RunningScriptsWidget::keyPressEvent(QKeyEvent *e)
void RunningScriptsWidget::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.setPen(QColor::fromRgb(225, 225, 225));
painter.setPen(QColor::fromRgb(225, 225, 225)); // #e1e1e1
if (ui->currentlyRunningLabel->isVisible()) {
// line below the 'Currently Running' label
painter.drawLine(21, ui->currentlyRunningLabel->y() + ui->currentlyRunningLabel->height(),
width() - 22, ui->currentlyRunningLabel->y() + ui->currentlyRunningLabel->height());
painter.drawLine(36, ui->currentlyRunningLabel->y() + ui->currentlyRunningLabel->height(),
300, ui->currentlyRunningLabel->y() + ui->currentlyRunningLabel->height());
}
if (ui->recentlyLoadedLabel->isVisible()) {
// line below the 'Recently loaded' label
painter.drawLine(21, ui->recentlyLoadedLabel->y() + ui->recentlyLoadedLabel->height(),
width() - 22, ui->recentlyLoadedLabel->y() + ui->recentlyLoadedLabel->height());
painter.drawLine(36, ui->recentlyLoadedLabel->y() + ui->recentlyLoadedLabel->height(),
300, ui->recentlyLoadedLabel->y() + ui->recentlyLoadedLabel->height());
}
painter.end();

View file

@ -28,11 +28,11 @@ ScriptsTableWidget::ScriptsTableWidget(QWidget *parent) :
void ScriptsTableWidget::paintEvent(QPaintEvent *event)
{
QPainter painter(viewport());
painter.setPen(QColor::fromRgb(225, 225, 225));
painter.setPen(QColor::fromRgb(225, 225, 225)); // #e1e1e1
int y = 0;
for (int i = 0; i < rowCount(); ++i) {
painter.drawLine(6, rowHeight(i) + y, width(), rowHeight(i) + y);
painter.drawLine(5, rowHeight(i) + y, width(), rowHeight(i) + y);
y += rowHeight(i);
}
painter.end();

View file

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>310</width>
<width>323</width>
<height>651</height>
</rect>
</property>
@ -24,15 +24,16 @@ QWidget {
<widget class="QLabel" name="widgetTitle">
<property name="geometry">
<rect>
<x>20</x>
<y>10</y>
<x>37</x>
<y>29</y>
<width>251</width>
<height>31</height>
<height>20</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">color: #0e7077;
font-size: 20pt;</string>
font-size: 20pt;
background: transparent;</string>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:18pt;&quot;&gt;Running Scripts&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
@ -47,15 +48,16 @@ font-size: 20pt;</string>
<widget class="QLabel" name="currentlyRunningLabel">
<property name="geometry">
<rect>
<x>20</x>
<y>40</y>
<x>36</x>
<y>70</y>
<width>270</width>
<height>20</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">color: #0e7077;
font: bold 14pt;</string>
font: bold 14pt;
background: transparent;</string>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Currently running&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
@ -64,7 +66,7 @@ font: bold 14pt;</string>
<widget class="QPushButton" name="reloadAllButton">
<property name="geometry">
<rect>
<x>20</x>
<x>36</x>
<y>230</y>
<width>111</width>
<height>35</height>
@ -93,9 +95,9 @@ font: bold 14pt;</string>
<widget class="QPushButton" name="stopAllButton">
<property name="geometry">
<rect>
<x>144</x>
<x>160</x>
<y>230</y>
<width>101</width>
<width>93</width>
<height>35</height>
</rect>
</property>
@ -119,9 +121,9 @@ font: bold 14pt;</string>
<widget class="QLabel" name="recentlyLoadedLabel">
<property name="geometry">
<rect>
<x>20</x>
<x>36</x>
<y>280</y>
<width>301</width>
<width>265</width>
<height>20</height>
</rect>
</property>
@ -136,10 +138,10 @@ font: bold 14pt;</string>
<widget class="QLabel" name="recentlyLoadedInstruction">
<property name="geometry">
<rect>
<x>20</x>
<x>36</x>
<y>590</y>
<width>271</width>
<height>41</height>
<width>203</width>
<height>31</height>
</rect>
</property>
<property name="styleSheet">
@ -156,10 +158,10 @@ font-size: 14pt;</string>
<widget class="QPushButton" name="hideWidgetButton">
<property name="geometry">
<rect>
<x>270</x>
<y>10</y>
<width>31</width>
<height>31</height>
<x>285</x>
<y>29</y>
<width>16</width>
<height>16</height>
</rect>
</property>
<property name="cursor">
@ -174,8 +176,8 @@ font-size: 14pt;</string>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="flat">
@ -185,8 +187,8 @@ font-size: 14pt;</string>
<widget class="QLabel" name="noRunningScriptsLabel">
<property name="geometry">
<rect>
<x>20</x>
<y>60</y>
<x>36</x>
<y>70</y>
<width>271</width>
<height>51</height>
</rect>
@ -198,15 +200,15 @@ font-size: 14pt;</string>
<string>There are no scripts currently running.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QWidget" name="recentlyLoadedScriptsTableWidget" native="true">
<property name="geometry">
<rect>
<x>14</x>
<x>30</x>
<y>300</y>
<width>276</width>
<width>272</width>
<height>280</height>
</rect>
</property>
@ -218,9 +220,9 @@ font-size: 14pt;</string>
<widget class="QWidget" name="runningScriptsTableWidget" native="true">
<property name="geometry">
<rect>
<x>14</x>
<y>60</y>
<width>276</width>
<x>30</x>
<y>88</y>
<width>272</width>
<height>161</height>
</rect>
</property>
@ -229,6 +231,16 @@ font-size: 14pt;</string>
font-size: 14pt;</string>
</property>
</widget>
<zorder>widgetTitle</zorder>
<zorder>currentlyRunningLabel</zorder>
<zorder>recentlyLoadedLabel</zorder>
<zorder>recentlyLoadedInstruction</zorder>
<zorder>hideWidgetButton</zorder>
<zorder>recentlyLoadedScriptsTableWidget</zorder>
<zorder>runningScriptsTableWidget</zorder>
<zorder>noRunningScriptsLabel</zorder>
<zorder>reloadAllButton</zorder>
<zorder>stopAllButton</zorder>
</widget>
<resources>
<include location="../resources/resources.qrc"/>