From 08c8f53e953823967900b130e1b6278dc56a9099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Mon, 17 Jun 2013 18:30:09 +0200 Subject: [PATCH] a?adido t?tulo a la toolbar en windows y linux --- YACReaderLibrary/library_window.cpp | 9 +++++++++ YACReaderLibrary/yacreader_main_toolbar.cpp | 10 +++++++++- YACReaderLibrary/yacreader_main_toolbar.h | 2 ++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index 3271e6e4..9b896992 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -880,7 +880,15 @@ void LibraryWindow::loadCovers(const QModelIndex & mi) { TreeItem *item = static_cast(mi.internalPointer()); folderId = item->id; +#ifndef Q_OS_MAC + libraryToolBar->setCurrentFolderName(item->data(0).toString()); +#endif } +#ifndef Q_OS_MAC + else libraryToolBar->setCurrentFolderName(selectedLibrary->currentText()); +#endif + + //cambiado de orden, ya que al llamar a foldersFilter->clear() se invalidan los model index if(foldersFilter->text()!="") @@ -901,6 +909,7 @@ void LibraryWindow::loadCovers(const QModelIndex & mi) //comicView->setModel(NULL); dmCV->setupModelData(folderId,dm->getDatabase()); + comicView->setModel(dmCV); comicView->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft); comicView->horizontalHeader()->setMovable(true); diff --git a/YACReaderLibrary/yacreader_main_toolbar.cpp b/YACReaderLibrary/yacreader_main_toolbar.cpp index b394371d..fb3b718f 100644 --- a/YACReaderLibrary/yacreader_main_toolbar.cpp +++ b/YACReaderLibrary/yacreader_main_toolbar.cpp @@ -13,7 +13,7 @@ YACReaderMainToolBar::YACReaderMainToolBar(QWidget *parent) : { mainLayout = new QHBoxLayout; - currentFolder = new QLabel(tr("Root"),this); + currentFolder = new QLabel(this); currentFolder->setAlignment(Qt::AlignCenter); currentFolder->setStyleSheet(" QLabel {color:#404040; font-size:22px; font-weight:bold;}"); @@ -110,3 +110,11 @@ void YACReaderMainToolBar::addWideDivider() addDivider(); mainLayout->addSpacing(3); } + +void YACReaderMainToolBar::setCurrentFolderName(const QString & name) +{ + currentFolder->setText(name); + currentFolder->adjustSize(); + currentFolder->move((width()-currentFolder->width())/2,(height()-currentFolder->height())/2); + +} diff --git a/YACReaderLibrary/yacreader_main_toolbar.h b/YACReaderLibrary/yacreader_main_toolbar.h index c2f1d5d0..b27ad1a9 100644 --- a/YACReaderLibrary/yacreader_main_toolbar.h +++ b/YACReaderLibrary/yacreader_main_toolbar.h @@ -22,6 +22,8 @@ public: QToolButton * serverButton; QToolButton * helpButton; QToolButton * fullscreenButton; + + void setCurrentFolderName(const QString & name); signals: public slots: