summaryrefslogtreecommitdiff
path: root/src/loglist.cpp
diff options
context:
space:
mode:
authorAL <26797547+Al12rs@users.noreply.github.com>2020-02-26 19:20:56 +0100
committerAL <26797547+Al12rs@users.noreply.github.com>2020-02-26 19:20:56 +0100
commit60437644e455284d36c8e20dfdf1bae268e9f378 (patch)
tree2dfa5acfc195c6e57e60f7314aa5e143f416b3c4 /src/loglist.cpp
parent0a6c7dce971cbc2ba9c7472521170a58dc43ae84 (diff)
Enabled icons for all log level line.
Added new icon for Debug level. Moved icons after timestamp.
Diffstat (limited to 'src/loglist.cpp')
-rw-r--r--src/loglist.cpp12
1 files changed, 7 insertions, 5 deletions
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();