From 8950746c09677bce83885ae9c227117a4fe5ade9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sun, 26 May 2013 15:59:38 +0200 Subject: [PATCH] Corregido bug que causaba el cierre inesperado de YACReaderLibrary al realizar operaciones sobre c?mics y no hab?a ningun c?cmic seleccionado. Terminado el estilo de a la lista de c?mics y titled toolbar. --- CHANGELOG.txt | 4 ++- YACReaderLibrary/library_window.cpp | 29 ++++++++++++++++---- YACReaderLibrary/library_window.h | 1 + custom_widgets/yacreader_titled_toolbar.cpp | 2 +- images/colapse.png | Bin 117 -> 117 bytes images/expand.png | Bin 138 -> 138 bytes images/setRoot.png | Bin 146 -> 146 bytes 7 files changed, 28 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2532c600..8003bf98 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,9 +4,11 @@ A Añadidos títulos "Bibliotecas" y "Carpetas" a la barra de navegación Nuevos iconos para seleccionar la carpeta raíz, expandir y contraer todos. Botón para cambiar el puerto del servidor por el usuario. -Ahora las columnas de la tabla de cómics pueden reordenarse +Ahora las columnas de la lista de cómics pueden reordenarse Ahora YACReaderLibrary sólo permite una instancia ejecutandose. Columna leído añadida. +Cambiado estilo de la lista de cócmis +Corregidos bugs relacionados con realizar operaciones sobre cómics cuando no había ninguno seleccionado en la lista de cómics 6.2 Nueva ventana de "bienvenida" diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index 15144fd2..918982a3 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -166,9 +166,13 @@ void LibraryWindow::doLayout() foldersView->setSelectionBehavior(QAbstractItemView::SelectRows); comicView->setAlternatingRowColors(true); - comicView->setStyleSheet("QTableView {alternate-background-color: #F2F2F2;background-color: #FAFAFA;}" - "QTableView::item {border-bottom: 1px solid #E9E9E9;border-top: 1px solid #FEFEFE; padding-bottom:1px;}" - "QTableView::item:selected {outline: none; border-bottom: 1px solid #A9A9A9;border-top: 1px solid #A9A9A9; padding-bottom:1px; background-color: #A9A9A9; color: #FFFFFF; }" + comicView->verticalHeader()->setAlternatingRowColors(true); + comicView->setStyleSheet("QTableView {alternate-background-color: #F2F2F2;background-color: #FAFAFA; outline: 0px;}" + "QTableCornerButton::section {background-color:#F5F5F5; border:none; border-bottom:1px solid #B8BDC4; border-right:1px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D1D1D1, stop: 1 #B8BDC4);}" + "QTableView::item {outline: 0px; border-bottom: 1px solid #DFDFDF;border-top: 1px solid #FEFEFE; padding-bottom:1px; color:#252626;}" + "QTableView::item:selected {outline: 0px; border-bottom: 1px solid #7A8080;border-top: 1px solid #7A8080; padding-bottom:1px; background-color: #7A8080; color: #FFFFFF; }" + "QHeaderView::section:horizontal {background-color:#F5F5F5; border-bottom:1px solid #B8BDC4; border-right:1px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D1D1D1, stop: 1 #B8BDC4); border-left:none; border-top:none; padding:4px; color:#313232;}" + "QHeaderView::section:vertical {border-bottom: 1px solid #DFDFDF;border-top: 1px solid #FEFEFE;}" //"QTableView::item:hover {border-bottom: 1px solid #A3A3A3;border-top: 1px solid #A3A3A3; padding-bottom:1px; background-color: #A3A3A3; color: #FFFFFF; }" ""); //comicView->setItemDelegate(new YACReaderComicViewDelegate()); @@ -995,7 +999,8 @@ void LibraryWindow::openComic() void LibraryWindow::setCurrentComicsStatusReaded(bool readed) { - comicFlow->setMarks(dmCV->setComicsRead(comicView->selectionModel()->selectedRows(),readed)); + + comicFlow->setMarks(dmCV->setComicsRead(getSelectedComics(),readed)); comicFlow->updateMarks(); } @@ -1304,7 +1309,7 @@ void LibraryWindow::setFoldersFilter(QString filter) void LibraryWindow::showProperties() { - QModelIndexList indexList = comicView->selectionModel()->selectedRows(); + QModelIndexList indexList = getSelectedComics(); QList comics = dmCV->getComics(indexList); ComicDB c = comics[0]; @@ -1319,7 +1324,7 @@ void LibraryWindow::showProperties() void LibraryWindow::asignNumbers() { - QModelIndexList indexList = comicView->selectionModel()->selectedRows(); + QModelIndexList indexList = getSelectedComics(); int startingNumber = indexList[0].row()+1; if(indexList.count()>1) @@ -1447,4 +1452,16 @@ void LibraryWindow::manageUpdatingError(const QString & error) void LibraryWindow::manageOpeningLibraryError(const QString & error) { QMessageBox::critical(this,tr("Error opening the library"),error); +} + +QModelIndexList LibraryWindow::getSelectedComics() +{ + //se fuerza a que haya almenos una fila seleccionada TODO comprobar se se puede forzar a la tabla a que lo haga automáticamente + QModelIndexList selection = comicView->selectionModel()->selectedRows(); + if(selection.count()==0) + { + comicView->selectRow(comicFlow->centerIndex()); + selection = comicView->selectionModel()->selectedRows(); + } + return selection; } \ No newline at end of file diff --git a/YACReaderLibrary/library_window.h b/YACReaderLibrary/library_window.h index 12d22aa7..18254aa3 100644 --- a/YACReaderLibrary/library_window.h +++ b/YACReaderLibrary/library_window.h @@ -232,6 +232,7 @@ public: void manageCreatingError(const QString & error); void manageUpdatingError(const QString & error); void manageOpeningLibraryError(const QString & error); + QModelIndexList getSelectedComics(); }; #endif diff --git a/custom_widgets/yacreader_titled_toolbar.cpp b/custom_widgets/yacreader_titled_toolbar.cpp index 8cde71a7..5bda72ed 100644 --- a/custom_widgets/yacreader_titled_toolbar.cpp +++ b/custom_widgets/yacreader_titled_toolbar.cpp @@ -18,7 +18,7 @@ YACReaderTitledToolBar::YACReaderTitledToolBar(const QString & title, QWidget *p QLabel * nameLabel = new QLabel(title,this); - QString nameLabelStyleSheet = "QLabel {color:#454545; padding:0 0 0 0px; margin:0px; font-size:13px; font-weight:bold;}"; + QString nameLabelStyleSheet = "QLabel {color:#656565; padding:0 0 0 0px; margin:0px; font-size:13px; font-weight:bold;}"; nameLabel->setStyleSheet(nameLabelStyleSheet); mainLayout->addWidget(nameLabel,Qt::AlignLeft); diff --git a/images/colapse.png b/images/colapse.png index 2a0b5782710b86da62c8447fcbc73f8071adc90d..6892fad8deb16724552c294fbaade52f9489104e 100644 GIT binary patch delta 41 wcmXRdoe-$vV?Ru6{1-oD!M|&e{!ntzg%KsC8ZcaZxF;-GUaT1q9N>yMJ0}yz+`njxgN@xNAR+0}a delta 40 vcmeBT>|&e{!ntnUy8jb@?k;~nF;-G!)nd*EA`+SJ7=Xaj)z4*}Q$iB}aGel- diff --git a/images/setRoot.png b/images/setRoot.png index b71a6541f19f3cc4321e2498a3e5df046c0f0305..d95234c286198793ef1df108b15b7d8b098c6eb8 100644 GIT binary patch delta 41 wcmbQlIEisWAeWD?@89zcY-#7`O^j9+dCbVOA#STm5(5x;y85}Sb4q9e06yXlYXATM delta 41 vcmbQlIEisWAXiCg>EH7WY-R87O^j9+DL3N&P@Cey$N&VMu6{1-oD!M