forked from qt-creator/qt-creator
Allow resizing of locator edit
Task-number: QTCREATORBUG-6719 Change-Id: I97a8972da3cb793324ca366bf4c977553e6bb38d Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -41,8 +41,9 @@ namespace Internal {
|
||||
class MiniSplitterHandle : public QSplitterHandle
|
||||
{
|
||||
public:
|
||||
MiniSplitterHandle(Qt::Orientation orientation, QSplitter *parent)
|
||||
: QSplitterHandle(orientation, parent)
|
||||
MiniSplitterHandle(Qt::Orientation orientation, QSplitter *parent, bool lightColored = false)
|
||||
: QSplitterHandle(orientation, parent),
|
||||
m_lightColored(lightColored)
|
||||
{
|
||||
setMask(QRegion(contentsRect()));
|
||||
setAttribute(Qt::WA_MouseNoMask, true);
|
||||
@@ -50,6 +51,9 @@ public:
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
void paintEvent(QPaintEvent *event);
|
||||
|
||||
private:
|
||||
bool m_lightColored;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
@@ -71,24 +75,26 @@ void MiniSplitterHandle::resizeEvent(QResizeEvent *event)
|
||||
void MiniSplitterHandle::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QPainter painter(this);
|
||||
painter.fillRect(event->rect(), Utils::StyleHelper::borderColor());
|
||||
painter.fillRect(event->rect(), Utils::StyleHelper::borderColor(m_lightColored));
|
||||
}
|
||||
|
||||
QSplitterHandle *MiniSplitter::createHandle()
|
||||
{
|
||||
return new MiniSplitterHandle(orientation(), this);
|
||||
return new MiniSplitterHandle(orientation(), this, m_style == Light);
|
||||
}
|
||||
|
||||
MiniSplitter::MiniSplitter(QWidget *parent)
|
||||
: QSplitter(parent)
|
||||
MiniSplitter::MiniSplitter(QWidget *parent, SplitterStyle style)
|
||||
: QSplitter(parent),
|
||||
m_style(style)
|
||||
{
|
||||
setHandleWidth(1);
|
||||
setChildrenCollapsible(false);
|
||||
setProperty("minisplitter", true);
|
||||
}
|
||||
|
||||
MiniSplitter::MiniSplitter(Qt::Orientation orientation)
|
||||
: QSplitter(orientation)
|
||||
MiniSplitter::MiniSplitter(Qt::Orientation orientation, SplitterStyle style)
|
||||
: QSplitter(orientation),
|
||||
m_style(style)
|
||||
{
|
||||
setHandleWidth(1);
|
||||
setChildrenCollapsible(false);
|
||||
|
||||
Reference in New Issue
Block a user