Commit 06a3c918 authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

ensure some proper frame like e.g. syntax menu + fix HiDPI issues

parent bf21a764
...@@ -203,12 +203,13 @@ public: ...@@ -203,12 +203,13 @@ public:
Q_DECLARE_METATYPE(QPointer<KTextEditor::Document>) Q_DECLARE_METATYPE(QPointer<KTextEditor::Document>)
KateQuickOpen::KateQuickOpen(KateMainWindow *mainWindow) KateQuickOpen::KateQuickOpen(KateMainWindow *mainWindow)
: QWidget(mainWindow) : QMenu(mainWindow)
, m_mainWindow(mainWindow) , m_mainWindow(mainWindow)
{ {
// ensure the components have some proper frame
QVBoxLayout *layout = new QVBoxLayout(); QVBoxLayout *layout = new QVBoxLayout();
layout->setSpacing(0); layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(4, 4, 4, 4);
setLayout(layout); setLayout(layout);
m_inputLine = new QuickOpenLineEdit(this); m_inputLine = new QuickOpenLineEdit(this);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#ifndef KATE_QUICK_OPEN_H #ifndef KATE_QUICK_OPEN_H
#define KATE_QUICK_OPEN_H #define KATE_QUICK_OPEN_H
#include <QWidget> #include <QMenu>
#include "katequickopenlineedit.h" #include "katequickopenlineedit.h"
...@@ -24,7 +24,7 @@ enum KateQuickOpenModelList : int; ...@@ -24,7 +24,7 @@ enum KateQuickOpenModelList : int;
class QuickOpenFilterProxyModel; class QuickOpenFilterProxyModel;
class KateQuickOpen : public QWidget class KateQuickOpen : public QMenu
{ {
Q_OBJECT Q_OBJECT
public: public:
......
...@@ -24,7 +24,7 @@ void SwitchModeButton::paintEvent(QPaintEvent *) ...@@ -24,7 +24,7 @@ void SwitchModeButton::paintEvent(QPaintEvent *)
{ {
const QPixmap iconPixmap = m_icon.pixmap(sizeHint(), QIcon::Normal); const QPixmap iconPixmap = m_icon.pixmap(sizeHint(), QIcon::Normal);
QStylePainter painter(this); QStylePainter painter(this);
QRect pixmapRect(QPoint(0,0), iconPixmap.size() / devicePixelRatio()); QRect pixmapRect(QPoint(0,0), sizeHint());
pixmapRect.moveCenter(rect().center()); pixmapRect.moveCenter(rect().center());
painter.drawPixmap(pixmapRect, iconPixmap); painter.drawPixmap(pixmapRect, iconPixmap);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment