From 49f000d11a92c7f93a04bacec64379cc412d4194 Mon Sep 17 00:00:00 2001 From: Victor Zarubkin Date: Sat, 3 Mar 2018 03:01:41 +0300 Subject: [PATCH] #0 [Gui] Windows styling fix --- profiler_gui/blocks_graphics_view.cpp | 15 +++++++++++---- profiler_gui/themes/default.css | 2 +- profiler_gui/themes/default.scss | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/profiler_gui/blocks_graphics_view.cpp b/profiler_gui/blocks_graphics_view.cpp index 81dcee4..17f9222 100644 --- a/profiler_gui/blocks_graphics_view.cpp +++ b/profiler_gui/blocks_graphics_view.cpp @@ -2308,14 +2308,14 @@ void ThreadNamesWidget::onTreeChange() auto vbar = verticalScrollBar(); auto viewBar = m_view->verticalScrollBar(); + auto r = m_view->sceneRect(); + setSceneRect(0, r.top(), maxLength, r.height() + m_additionalHeight); + setVerticalScrollbarRange(viewBar->minimum(), viewBar->maximum()); vbar->setSingleStep(viewBar->singleStep()); vbar->setPageStep(viewBar->pageStep()); vbar->setValue(viewBar->value()); - auto r = m_view->sceneRect(); - setSceneRect(0, r.top(), maxLength, r.height() + m_additionalHeight); - auto item = new ThreadNameItem(); item->setPos(0, 0); item->setBoundingRect(sceneRect()); @@ -2568,8 +2568,15 @@ void ThreadNamesWidget::wheelEvent(QWheelEvent* _event) if (vbar != nullptr) { _event->accept(); + + const auto prev = vbar->value(); vbar->setValue(vbar->value() - _event->delta()); - verticalScrollBar()->setValue(vbar->value()); + + if (prev != vbar->value()) + { + verticalScrollBar()->setValue(vbar->value()); + repaintScene(); + } } } diff --git a/profiler_gui/themes/default.css b/profiler_gui/themes/default.css index 52fc8a8..8b7213e 100644 --- a/profiler_gui/themes/default.css +++ b/profiler_gui/themes/default.css @@ -148,7 +148,7 @@ QTreeView::branch { border-bottom: 1px solid #cccccc; } QTreeView::branch:selected { - background-color: transparent; } + background-color: rgba(152, 222, 152, 0.8); } QTreeView::branch:open:has-children { padding: 9px 0 9px 0; diff --git a/profiler_gui/themes/default.scss b/profiler_gui/themes/default.scss index f001411..7b81bc3 100644 --- a/profiler_gui/themes/default.scss +++ b/profiler_gui/themes/default.scss @@ -166,7 +166,7 @@ QTreeView::branch { } QTreeView::branch:selected { - background-color: transparent; + background-color: rgb_a(#98DE98, 0.8); } QTreeView::branch:open:has-children {