summary refs log tree commit diff
path: root/src/emoji/Panel.cpp
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2020-02-28 19:10:39 -0500
committerGitHub <noreply@github.com>2020-02-28 19:10:39 -0500
commit30cb7c5b02bb8a21a8d7257cfe5a8bd3db891606 (patch)
treeddadd16c86600ce937b47798a9b3d5ff2fdec998 /src/emoji/Panel.cpp
parentMerge pull request #129 from nico202/master (diff)
parentMerge branch 'master' into 0.7.0-dev (diff)
downloadnheko-30cb7c5b02bb8a21a8d7257cfe5a8bd3db891606.tar.xz
Merge pull request #130 from Nheko-Reborn/0.7.0-dev
0.7.0 dev merge to master
Diffstat (limited to 'src/emoji/Panel.cpp')
-rw-r--r--src/emoji/Panel.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/emoji/Panel.cpp b/src/emoji/Panel.cpp

index 710b501e..f0e4449d 100644 --- a/src/emoji/Panel.cpp +++ b/src/emoji/Panel.cpp
@@ -15,6 +15,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <QPainter> #include <QPushButton> #include <QScrollBar> #include <QVBoxLayout> @@ -34,10 +35,6 @@ Panel::Panel(QWidget *parent) , height_{350} , categoryIconSize_{20} { - setStyleSheet("QWidget {border: none;}" - "QScrollBar:vertical { width: 0px; margin: 0px; }" - "QScrollBar::handle:vertical { min-height: 30px; }"); - setAttribute(Qt::WA_ShowWithoutActivating, true); setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint); @@ -202,14 +199,12 @@ Panel::showCategory(const Category *category) return; // HACK - // If we want to go to a previous category and position the label at the top - // the 6*50 offset won't work because not all the categories have the same - // height. To ensure the category is at the top, we move to the top and go as - // normal to the next category. + // We want the top of the category to be visible, so scroll to the top first and then to the + // category if (current > posToGo) this->scrollArea_->ensureVisible(0, 0, 0, 0); - posToGo += 6 * 50; + posToGo += scrollArea_->height(); this->scrollArea_->ensureVisible(0, posToGo, 0, 0); }