summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAl <26797547+Al12rs@users.noreply.github.com>2020-02-27 11:02:34 +0100
committerGitHub <noreply@github.com>2020-02-27 11:02:34 +0100
commita44100ada11a5e7a9849d4308bcb533bf65567ef (patch)
tree2499044e60ebfb4044e1fe10204ef627d923e30b /src
parent756056fcc3fce44f9ceaccfb5e9f2e9c9c0257fb (diff)
parentc2e2be8ff7953c59cbf51024e3ff0249ad83387c (diff)
Merge pull request #1021 from Al12rs/log_changes
Various UI changes:
Diffstat (limited to 'src')
-rw-r--r--src/filterlist.cpp17
-rw-r--r--src/loglist.cpp12
-rw-r--r--src/mainwindow.ui46
-rw-r--r--src/resources.qrc4
-rw-r--r--src/resources/icons8-checked-checkbox.pngbin0 -> 886 bytes
-rw-r--r--src/resources/icons8-indeterminate-checkbox.pngbin0 -> 674 bytes
-rw-r--r--src/resources/icons8-unchecked-checkbox.pngbin0 -> 545 bytes
-rw-r--r--src/resources/log-debug.pngbin0 -> 1039 bytes
8 files changed, 56 insertions, 23 deletions
diff --git a/src/filterlist.cpp b/src/filterlist.cpp
index 144c5689..57bc740a 100644
--- a/src/filterlist.cpp
+++ b/src/filterlist.cpp
@@ -29,6 +29,7 @@ public:
setData(0, Qt::ToolTipRole, name);
setData(0, TypeRole, type);
setData(0, IDRole, id);
+ setData(0, Qt::DecorationRole, QIcon(":/MO/gui/unchecked-checkbox"));
}
CriteriaType type() const
@@ -83,30 +84,29 @@ private:
void updateState()
{
- QString s;
+ QIcon i;
switch (m_state)
{
case Inactive:
{
+ i = QIcon(":/MO/gui/unchecked-checkbox");
break;
}
case Active:
{
- // U+2713 CHECK MARK
- s = QString::fromUtf8("\xe2\x9c\x93");
+ i = QIcon(":/MO/gui/checked-checkbox");
break;
}
case Inverted:
{
- s = tr("Not");
+ i = QIcon(":/MO/gui/indeterminate-checkbox");
break;
}
}
-
- setText(0, s);
+ setData(0, Qt::DecorationRole, i);
}
};
@@ -199,8 +199,7 @@ FilterList::FilterList(Ui::MainWindow* ui, CategoryFactory& factory)
[&]{ onOptionsChanged(); });
ui->filters->header()->setMinimumSectionSize(0);
- ui->filters->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
- ui->filters->header()->resizeSection(0, 30);
+ ui->filters->header()->resizeSection(0, 23);
ui->categoriesSplitter->setCollapsible(0, false);
ui->categoriesSplitter->setCollapsible(1, false);
@@ -229,8 +228,6 @@ QTreeWidgetItem* FilterList::addCriteriaItem(
// no way to espand nodes in the filter view since clicking changes state.
ui->filters->addTopLevelItem(item);
- item->setTextAlignment(0, Qt::AlignCenter);
-
return item;
}
diff --git a/src/loglist.cpp b/src/loglist.cpp
index 28aae0ff..31f1817f 100644
--- a/src/loglist.cpp
+++ b/src/loglist.cpp
@@ -117,7 +117,7 @@ QVariant LogModel::data(const QModelIndex& index, int role) const
const auto& e = m_entries[row];
if (role == Qt::DisplayRole) {
- if (index.column() == 1) {
+ if (index.column() == 0) {
const auto ms = duration_cast<milliseconds>(e.time.time_since_epoch());
const auto s = duration_cast<seconds>(ms);
@@ -132,7 +132,7 @@ QVariant LogModel::data(const QModelIndex& index, int role) const
}
if (role == Qt::DecorationRole) {
- if (index.column() == 0) {
+ if (index.column() == 1) {
switch (e.level) {
case log::Warning:
return QIcon(":/MO/gui/warning");
@@ -140,8 +140,10 @@ QVariant LogModel::data(const QModelIndex& index, int role) const
case log::Error:
return QIcon(":/MO/gui/problem");
- case log::Debug: // fall-through
+ case log::Debug:
+ return QIcon(":/MO/gui/debug");
case log::Info:
+ return QIcon(":/MO/gui/information");
default:
return {};
}
@@ -163,8 +165,8 @@ LogList::LogList(QWidget* parent)
setModel(&LogModel::instance());
header()->setMinimumSectionSize(0);
- header()->resizeSection(0, 20);
- header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
+ header()->resizeSection(1, 20);
+ header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
setAutoScroll(true);
scrollToBottom();
diff --git a/src/mainwindow.ui b/src/mainwindow.ui
index ffa2460f..83aba71a 100644
--- a/src/mainwindow.ui
+++ b/src/mainwindow.ui
@@ -60,13 +60,13 @@
<number>3</number>
</property>
<property name="topMargin">
- <number>7</number>
+ <number>15</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
- <number>1</number>
+ <number>0</number>
</property>
<item>
<widget class="QTreeWidget" name="filters">
@@ -102,7 +102,7 @@
</attribute>
<column>
<property name="text">
- <string>State</string>
+ <string/>
</property>
<property name="toolTip">
<string>State of the filter, can either be Disabled, Enabled or Inverted.</string>
@@ -158,18 +158,18 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <layout class="QHBoxLayout" name="horizontalLayout_11">
+ <layout class="QHBoxLayout" name="horizontalLayout_11" stretch="1,1,2">
<property name="leftMargin">
- <number>0</number>
+ <number>1</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
- <number>0</number>
+ <number>1</number>
</property>
<property name="bottomMargin">
- <number>0</number>
+ <number>2</number>
</property>
<item>
<widget class="QRadioButton" name="filtersAnd">
@@ -196,6 +196,12 @@
</item>
<item>
<widget class="QComboBox" name="filtersSeparators">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="toolTip">
<string>Filter: only show the separators that match the current filters
Show: always show separators
@@ -582,9 +588,15 @@ p, li { white-space: pre-wrap; }
</widget>
<widget class="QWidget" name="layoutWidget_2">
<layout class="QVBoxLayout" name="verticalLayout_2">
+ <property name="spacing">
+ <number>2</number>
+ </property>
<item>
<widget class="QFrame" name="startGroup">
<layout class="QHBoxLayout" name="horizontalLayout_5" stretch="1,0">
+ <property name="bottomMargin">
+ <number>4</number>
+ </property>
<item>
<widget class="QComboBox" name="executablesListBox">
<property name="sizePolicy">
@@ -1410,7 +1422,7 @@ p, li { white-space: pre-wrap; }
<x>0</x>
<y>0</y>
<width>1009</width>
- <height>22</height>
+ <height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@@ -1480,6 +1492,12 @@ p, li { white-space: pre-wrap; }
<addaction name="menuHelp"/>
</widget>
<widget class="QDockWidget" name="logDock">
+ <property name="minimumSize">
+ <size>
+ <width>80</width>
+ <height>42</height>
+ </size>
+ </property>
<property name="features">
<set>QDockWidget::AllDockWidgetFeatures</set>
</property>
@@ -1505,6 +1523,18 @@ p, li { white-space: pre-wrap; }
</property>
<item>
<widget class="LogList" name="logList">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>30</width>
+ <height>20</height>
+ </size>
+ </property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
diff --git a/src/resources.qrc b/src/resources.qrc
index 5b143b45..c54d5bfc 100644
--- a/src/resources.qrc
+++ b/src/resources.qrc
@@ -33,6 +33,10 @@
<file alias="emblem_backup">resources/symbol-backup.png</file>
<file alias="icon_tools">resources/applications-accessories.png</file>
<file alias="problem">resources/emblem-unreadable.png</file>
+ <file alias="debug">resources/log-debug.png</file>
+ <file alias="checked-checkbox">resources/icons8-checked-checkbox.png</file>
+ <file alias="unchecked-checkbox">resources/icons8-unchecked-checkbox.png</file>
+ <file alias="indeterminate-checkbox">resources/icons8-indeterminate-checkbox.png</file>
<file>resources/internet-web-browser.png</file>
<file alias="update">resources/system-software-update.png</file>
<file alias="help">resources/help-browser_32.png</file>
diff --git a/src/resources/icons8-checked-checkbox.png b/src/resources/icons8-checked-checkbox.png
new file mode 100644
index 00000000..1a36d1f3
--- /dev/null
+++ b/src/resources/icons8-checked-checkbox.png
Binary files differ
diff --git a/src/resources/icons8-indeterminate-checkbox.png b/src/resources/icons8-indeterminate-checkbox.png
new file mode 100644
index 00000000..4f386c44
--- /dev/null
+++ b/src/resources/icons8-indeterminate-checkbox.png
Binary files differ
diff --git a/src/resources/icons8-unchecked-checkbox.png b/src/resources/icons8-unchecked-checkbox.png
new file mode 100644
index 00000000..c56a74e5
--- /dev/null
+++ b/src/resources/icons8-unchecked-checkbox.png
Binary files differ
diff --git a/src/resources/log-debug.png b/src/resources/log-debug.png
new file mode 100644
index 00000000..05ba742c
--- /dev/null
+++ b/src/resources/log-debug.png
Binary files differ