Commit dd731a89 authored by Eike Ziller's avatar Eike Ziller
Browse files

Add right aligned location for widget in status bar.



Change-Id: I7ff41fc891836d15b2b9b6bf090feaf2e4feb968
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent 90ba1c2f
......@@ -41,20 +41,30 @@
using namespace Core;
using namespace Core::Internal;
static QWidget *createWidget()
{
QWidget *w = new QWidget();
w->setLayout(new QHBoxLayout);
w->setVisible(true);
w->layout()->setMargin(0);
return w;
}
StatusBarManager::StatusBarManager(MainWindow *mainWnd)
: QObject(mainWnd),
m_mainWnd(mainWnd)
{
for (int i = 0; i <= StatusBarWidget::Last; ++i) {
QWidget *w = new QWidget();
for (int i = 0; i <= StatusBarWidget::LastLeftAligned; ++i) {
QWidget *w = createWidget();
m_mainWnd->statusBar()->insertPermanentWidget(i, w);
w->setLayout(new QHBoxLayout);
w->setVisible(true);
w->layout()->setMargin(0);
m_statusBarWidgets.append(w);
}
m_mainWnd->statusBar()->insertPermanentWidget(StatusBarWidget::Last+1,
m_mainWnd->statusBar()->insertPermanentWidget(StatusBarWidget::LastLeftAligned + 1,
new QLabel(), 1);
QWidget *rightCornerWidget = createWidget();
m_mainWnd->statusBar()->insertPermanentWidget(StatusBarWidget::LastLeftAligned + 2,
rightCornerWidget);
m_statusBarWidgets.append(rightCornerWidget);
}
StatusBarManager::~StatusBarManager()
......
......@@ -40,7 +40,7 @@ class CORE_EXPORT StatusBarWidget : public IContext
Q_OBJECT
public:
enum StatusBarPosition { First=0, Second=1, Third=2, Last=Third };
enum StatusBarPosition { First=0, Second=1, Third=2, LastLeftAligned=Third, RightCorner};
StatusBarWidget(QObject *parent = 0);
~StatusBarWidget();
......
......@@ -2051,7 +2051,7 @@ void FakeVimPlugin::extensionsInitialized()
{
d->m_statusBar = new StatusBarWidget;
d->m_statusBar->setWidget(new MiniBuffer);
d->m_statusBar->setPosition(StatusBarWidget::Last);
d->m_statusBar->setPosition(StatusBarWidget::LastLeftAligned);
addAutoReleasedObject(d->m_statusBar);
}
......
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