mirror of
https://github.com/YACReader/yacreader
synced 2025-07-22 23:15:14 -04:00
sidebar status is now saved on close
This commit is contained in:
@ -2495,6 +2495,7 @@ void LibraryWindow::closeEvent ( QCloseEvent * event )
|
|||||||
settings->setValue(MAIN_WINDOW_GEOMETRY, saveGeometry());
|
settings->setValue(MAIN_WINDOW_GEOMETRY, saveGeometry());
|
||||||
|
|
||||||
comicsView->close();
|
comicsView->close();
|
||||||
|
sideBar->close();
|
||||||
|
|
||||||
QApplication::instance()->processEvents();
|
QApplication::instance()->processEvents();
|
||||||
event->accept();
|
event->accept();
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
#define COMICS_VIEW_HEADERS_GEOMETRY "COMICS_VIEW_HEADERS_GEOMETRY"
|
#define COMICS_VIEW_HEADERS_GEOMETRY "COMICS_VIEW_HEADERS_GEOMETRY"
|
||||||
#define COMICS_VIEW_STATUS "COMICS_VIEW_STATUS"
|
#define COMICS_VIEW_STATUS "COMICS_VIEW_STATUS"
|
||||||
#define COMICS_VIEW_FLOW_SPLITTER_STATUS "COMICS_VIEW_FLOW_SPLITTER_STATUS"
|
#define COMICS_VIEW_FLOW_SPLITTER_STATUS "COMICS_VIEW_FLOW_SPLITTER_STATUS"
|
||||||
|
#define SIDEBAR_SPLITTER_STATUS "SIDEBAR_SPLITTER_STATUS"
|
||||||
|
|
||||||
#define NUM_DAYS_BETWEEN_VERSION_CHECKS "NUM_DAYS_BETWEEN_VERSION_CHECKS"
|
#define NUM_DAYS_BETWEEN_VERSION_CHECKS "NUM_DAYS_BETWEEN_VERSION_CHECKS"
|
||||||
#define LAST_VERSION_CHECK "LAST_VERSION_CHECK"
|
#define LAST_VERSION_CHECK "LAST_VERSION_CHECK"
|
||||||
|
@ -15,6 +15,9 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Minimum);
|
setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Minimum);
|
||||||
|
|
||||||
|
settings = new QSettings(YACReader::getSettingsPath()+"/YACReaderLibrary.ini",QSettings::IniFormat); //TODO unificar la creación del fichero de config con el servidor
|
||||||
|
settings->beginGroup("libraryConfig");
|
||||||
|
|
||||||
//widgets
|
//widgets
|
||||||
foldersView = new YACReaderFoldersView;
|
foldersView = new YACReaderFoldersView;
|
||||||
readingListsView = new YACReaderReadingListsView;
|
readingListsView = new YACReaderReadingListsView;
|
||||||
@ -134,6 +137,9 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent) :
|
|||||||
l->setSpacing(0);
|
l->setSpacing(0);
|
||||||
|
|
||||||
setLayout(l);
|
setLayout(l);
|
||||||
|
|
||||||
|
if(settings->contains(SIDEBAR_SPLITTER_STATUS))
|
||||||
|
splitter->restoreState(settings->value(SIDEBAR_SPLITTER_STATUS).toByteArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -165,7 +171,12 @@ void YACReaderSideBar::paintEvent(QPaintEvent * event)
|
|||||||
// painter.setRenderHint(QPainter::Antialiasing);
|
// painter.setRenderHint(QPainter::Antialiasing);
|
||||||
// painter.drawLine(rect().topLeft(), rect().bottomRight());
|
// painter.drawLine(rect().topLeft(), rect().bottomRight());
|
||||||
|
|
||||||
//QWidget::paintEvent(event);
|
//QWidget::paintEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void YACReaderSideBar::closeEvent(QCloseEvent *event)
|
||||||
|
{
|
||||||
|
settings->setValue(SIDEBAR_SPLITTER_STATUS, splitter->saveState());
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize YACReaderSideBar::sizeHint() const
|
QSize YACReaderSideBar::sizeHint() const
|
||||||
|
@ -31,8 +31,6 @@ public:
|
|||||||
YACReaderTitledToolBar * librariesTitle;
|
YACReaderTitledToolBar * librariesTitle;
|
||||||
YACReaderTitledToolBar * foldersTitle;
|
YACReaderTitledToolBar * foldersTitle;
|
||||||
YACReaderTitledToolBar * readingListsTitle;
|
YACReaderTitledToolBar * readingListsTitle;
|
||||||
|
|
||||||
QSplitter * splitter;
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
@ -40,6 +38,9 @@ public slots:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent *);
|
void paintEvent(QPaintEvent *);
|
||||||
|
void closeEvent ( QCloseEvent * event );
|
||||||
|
QSettings * settings;
|
||||||
|
QSplitter * splitter;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user