From 51ffe5eacd2693c88929a8df902f5ad037097ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Tue, 22 Oct 2013 21:15:58 +0200 Subject: [PATCH] fixed toolbar title (on start, on maximize, ...) --- YACReaderLibrary/library_window.cpp | 2 +- YACReaderLibrary/yacreader_main_toolbar.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index 3d5f1640..930c9307 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -135,7 +135,7 @@ void LibraryWindow::doLayout() #ifdef Q_OS_MAC libraryToolBar = addToolBar(tr("Library")); #else - libraryToolBar = new YACReaderMainToolBar; + libraryToolBar = new YACReaderMainToolBar(this); #endif //FLOW----------------------------------------------------------------------- diff --git a/YACReaderLibrary/yacreader_main_toolbar.cpp b/YACReaderLibrary/yacreader_main_toolbar.cpp index 011c579e..61f6a3da 100644 --- a/YACReaderLibrary/yacreader_main_toolbar.cpp +++ b/YACReaderLibrary/yacreader_main_toolbar.cpp @@ -100,6 +100,7 @@ void YACReaderMainToolBar::resizeEvent(QResizeEvent * event) QString clippedText = metrix.elidedText(currentFolderName, Qt::ElideRight, maxLabelWidth); currentFolder->setText(clippedText); + currentFolder->adjustSize(); currentFolder->move((event->size().width()-currentFolder->width())/2,(event->size().height()-currentFolder->height())/2); } @@ -135,6 +136,6 @@ void YACReaderMainToolBar::setCurrentFolderName(const QString & name) QString clippedText = metrix.elidedText(currentFolderName, Qt::ElideRight, maxLabelWidth); currentFolder->setText(clippedText); - + currentFolder->adjustSize(); currentFolder->move((width()-currentFolder->width())/2,(height()-currentFolder->height())/2); }