Commit 92cb4fca authored by con's avatar con
Browse files

Use mini scrollbars for popups on Mac.

parent b8af05e6
...@@ -211,6 +211,12 @@ CompletionList::CompletionList(QWidget *parent) ...@@ -211,6 +211,12 @@ CompletionList::CompletionList(QWidget *parent)
// This is too slow when done on all results // This is too slow when done on all results
//header()->setResizeMode(QHeaderView::ResizeToContents); //header()->setResizeMode(QHeaderView::ResizeToContents);
setWindowFlags(Qt::ToolTip); setWindowFlags(Qt::ToolTip);
#ifdef Q_WS_MAC
if (horizontalScrollBar())
horizontalScrollBar()->setAttribute(Qt::WA_MacMiniSize);
if (verticalScrollBar())
verticalScrollBar()->setAttribute(Qt::WA_MacMiniSize);
#endif
} }
void CompletionList::updatePreferredSize() void CompletionList::updatePreferredSize()
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <QtGui/QDesktopWidget> #include <QtGui/QDesktopWidget>
#include <QtGui/QKeyEvent> #include <QtGui/QKeyEvent>
#include <QtGui/QVBoxLayout> #include <QtGui/QVBoxLayout>
#include <QtGui/QScrollBar>
#include <limits.h> #include <limits.h>
...@@ -227,6 +228,12 @@ CompletionListView::CompletionListView(CompletionSupport *support, ITextEditable ...@@ -227,6 +228,12 @@ CompletionListView::CompletionListView(CompletionSupport *support, ITextEditable
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setMinimumSize(1, 1); setMinimumSize(1, 1);
setModel(m_model); setModel(m_model);
#ifdef Q_WS_MAC
if (horizontalScrollBar())
horizontalScrollBar()->setAttribute(Qt::WA_MacMiniSize);
if (verticalScrollBar())
verticalScrollBar()->setAttribute(Qt::WA_MacMiniSize);
#endif
} }
CompletionListView::~CompletionListView() CompletionListView::~CompletionListView()
......
Supports Markdown
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