From 0a6c7dce971cbc2ba9c7472521170a58dc43ae84 Mon Sep 17 00:00:00 2001 From: AL <26797547+Al12rs@users.noreply.github.com> Date: Wed, 26 Feb 2020 14:50:19 +0100 Subject: Allow log to be reduced in size to a greater extent. --- src/mainwindow.ui | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mainwindow.ui b/src/mainwindow.ui index ffa2460f..c9a88655 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -1410,7 +1410,7 @@ p, li { white-space: pre-wrap; } 0 0 1009 - 22 + 21 @@ -1480,6 +1480,12 @@ p, li { white-space: pre-wrap; } + + + 0 + 0 + + QDockWidget::AllDockWidgetFeatures @@ -1505,6 +1511,18 @@ p, li { white-space: pre-wrap; } + + + 0 + 0 + + + + + 30 + 20 + + Qt::CustomContextMenu -- cgit v1.3.1 From 60437644e455284d36c8e20dfdf1bae268e9f378 Mon Sep 17 00:00:00 2001 From: AL <26797547+Al12rs@users.noreply.github.com> Date: Wed, 26 Feb 2020 19:20:56 +0100 Subject: Enabled icons for all log level line. Added new icon for Debug level. Moved icons after timestamp. --- src/loglist.cpp | 12 +++++++----- src/resources.qrc | 1 + src/resources/log-debug.png | Bin 0 -> 1039 bytes 3 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 src/resources/log-debug.png (limited to 'src') 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(e.time.time_since_epoch()); const auto s = duration_cast(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/resources.qrc b/src/resources.qrc index 5b143b45..f9b64f6f 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -33,6 +33,7 @@ resources/symbol-backup.png resources/applications-accessories.png resources/emblem-unreadable.png + resources/log-debug.png resources/internet-web-browser.png resources/system-software-update.png resources/help-browser_32.png diff --git a/src/resources/log-debug.png b/src/resources/log-debug.png new file mode 100644 index 00000000..05ba742c Binary files /dev/null and b/src/resources/log-debug.png differ -- cgit v1.3.1 From c1554d1c3fe64968dd143f877bddae10cdcee423 Mon Sep 17 00:00:00 2001 From: AL <26797547+Al12rs@users.noreply.github.com> Date: Wed, 26 Feb 2020 19:22:15 +0100 Subject: Added checkbox icons for filterlist state --- src/filterlist.cpp | 13 +++++++++---- src/resources.qrc | 3 +++ src/resources/icons8-checked-checkbox.png | Bin 0 -> 886 bytes src/resources/icons8-indeterminate-checkbox.png | Bin 0 -> 674 bytes src/resources/icons8-unchecked-checkbox.png | Bin 0 -> 545 bytes 5 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 src/resources/icons8-checked-checkbox.png create mode 100644 src/resources/icons8-indeterminate-checkbox.png create mode 100644 src/resources/icons8-unchecked-checkbox.png (limited to 'src') diff --git a/src/filterlist.cpp b/src/filterlist.cpp index 144c5689..59f2e0be 100644 --- a/src/filterlist.cpp +++ b/src/filterlist.cpp @@ -29,6 +29,8 @@ public: setData(0, Qt::ToolTipRole, name); setData(0, TypeRole, type); setData(0, IDRole, id); + setData(0, Qt::DecorationRole, QIcon(":/MO/gui/unchecked-checkbox")); + setData(0, Qt::TextAlignmentRole, Qt::AlignCenter); } CriteriaType type() const @@ -84,11 +86,13 @@ private: void updateState() { QString s; + QIcon i; switch (m_state) { case Inactive: { + i = QIcon(":/MO/gui/unchecked-checkbox"); break; } @@ -96,17 +100,19 @@ private: { // 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); + //setText(0, s); + setData(0, Qt::DecorationRole, i); } }; @@ -199,8 +205,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); diff --git a/src/resources.qrc b/src/resources.qrc index f9b64f6f..c54d5bfc 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -34,6 +34,9 @@ resources/applications-accessories.png resources/emblem-unreadable.png resources/log-debug.png + resources/icons8-checked-checkbox.png + resources/icons8-unchecked-checkbox.png + resources/icons8-indeterminate-checkbox.png resources/internet-web-browser.png resources/system-software-update.png resources/help-browser_32.png diff --git a/src/resources/icons8-checked-checkbox.png b/src/resources/icons8-checked-checkbox.png new file mode 100644 index 00000000..1a36d1f3 Binary files /dev/null and b/src/resources/icons8-checked-checkbox.png differ diff --git a/src/resources/icons8-indeterminate-checkbox.png b/src/resources/icons8-indeterminate-checkbox.png new file mode 100644 index 00000000..4f386c44 Binary files /dev/null and b/src/resources/icons8-indeterminate-checkbox.png differ diff --git a/src/resources/icons8-unchecked-checkbox.png b/src/resources/icons8-unchecked-checkbox.png new file mode 100644 index 00000000..c56a74e5 Binary files /dev/null and b/src/resources/icons8-unchecked-checkbox.png differ -- cgit v1.3.1 From c4b95bad653420bd7ed322a5d952356f9705df9e Mon Sep 17 00:00:00 2001 From: AL <26797547+Al12rs@users.noreply.github.com> Date: Wed, 26 Feb 2020 19:24:15 +0100 Subject: Removed "State" header from filterlist. Allow lower vertical sizes for loglist. Fixed alignments and size of various elements. --- src/mainwindow.ui | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/mainwindow.ui b/src/mainwindow.ui index c9a88655..83aba71a 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -60,13 +60,13 @@ 3 - 7 + 15 3 - 1 + 0 @@ -102,7 +102,7 @@ - State + State of the filter, can either be Disabled, Enabled or Inverted. @@ -158,18 +158,18 @@ 0 - + - 0 + 1 2 - 0 + 1 - 0 + 2 @@ -196,6 +196,12 @@ + + + 0 + 0 + + Filter: only show the separators that match the current filters Show: always show separators @@ -582,9 +588,15 @@ p, li { white-space: pre-wrap; } + + 2 + + + 4 + @@ -1482,8 +1494,8 @@ p, li { white-space: pre-wrap; } - 0 - 0 + 80 + 42 -- cgit v1.3.1 From c2e2be8ff7953c59cbf51024e3ff0249ad83387c Mon Sep 17 00:00:00 2001 From: AL <26797547+Al12rs@users.noreply.github.com> Date: Wed, 26 Feb 2020 19:34:33 +0100 Subject: Cleanup previous filterList code --- src/filterlist.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src') diff --git a/src/filterlist.cpp b/src/filterlist.cpp index 59f2e0be..57bc740a 100644 --- a/src/filterlist.cpp +++ b/src/filterlist.cpp @@ -30,7 +30,6 @@ public: setData(0, TypeRole, type); setData(0, IDRole, id); setData(0, Qt::DecorationRole, QIcon(":/MO/gui/unchecked-checkbox")); - setData(0, Qt::TextAlignmentRole, Qt::AlignCenter); } CriteriaType type() const @@ -85,7 +84,6 @@ private: void updateState() { - QString s; QIcon i; switch (m_state) @@ -98,20 +96,16 @@ private: 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); } }; @@ -234,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; } -- cgit v1.3.1