mirror of
https://github.com/YACReader/yacreader
synced 2025-07-19 05:24:57 -04:00
Fixed main toolbar title in YACReaderLibrary
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
6.9 (No p<>blica)
|
||||
A<EFBFBD>adida la apertura autom<6F>tica del siguiente/anterior c<>mic al llegar al final/portada del c<>mic actual
|
||||
Corregido el comportamiento del di<64>logo de nueva versi<73>n detectada. Ahora avisa una vez al d<>a o si el usuario lo elige cada 14 d<>as.
|
||||
Corregido el ajuste a lo ancho del t<>tulo de la toolbar en YACReaderLibrary.
|
||||
|
||||
6.8 (No p<>blica)
|
||||
Corregido bug que causaba un cierre inesperado despu<70>s de cambiar el modo de sincronizaci<63>n vertical (flow)
|
||||
|
@ -14,7 +14,7 @@ YACReaderMainToolBar::YACReaderMainToolBar(QWidget *parent) :
|
||||
mainLayout = new QHBoxLayout;
|
||||
|
||||
currentFolder = new QLabel(this);
|
||||
currentFolder->setAlignment(Qt::AlignCenter);
|
||||
//currentFolder->setAlignment(Qt::AlignCenter);
|
||||
currentFolder->setStyleSheet(" QLabel {color:#404040; font-size:22px; font-weight:bold;}");
|
||||
|
||||
QFont f=currentFolder->font();
|
||||
@ -90,6 +90,16 @@ void YACReaderMainToolBar::paintEvent(QPaintEvent * event)
|
||||
|
||||
void YACReaderMainToolBar::resizeEvent(QResizeEvent * event)
|
||||
{
|
||||
//210px x 2 = 420px
|
||||
int freeWidth = event->size().width() - 420;
|
||||
int maxLabelWidth = freeWidth>=0?freeWidth:0;
|
||||
currentFolder->setMaximumWidth(maxLabelWidth);
|
||||
currentFolder->adjustSize();
|
||||
|
||||
QFontMetrics metrix(currentFolder->font());
|
||||
QString clippedText = metrix.elidedText(currentFolderName, Qt::ElideRight, maxLabelWidth);
|
||||
|
||||
currentFolder->setText(clippedText);
|
||||
currentFolder->move((event->size().width()-currentFolder->width())/2,(event->size().height()-currentFolder->height())/2);
|
||||
}
|
||||
|
||||
@ -114,7 +124,17 @@ void YACReaderMainToolBar::addWideDivider()
|
||||
void YACReaderMainToolBar::setCurrentFolderName(const QString & name)
|
||||
{
|
||||
currentFolder->setText(name);
|
||||
currentFolderName = name;
|
||||
currentFolder->adjustSize();
|
||||
currentFolder->move((width()-currentFolder->width())/2,(height()-currentFolder->height())/2);
|
||||
|
||||
int freeWidth = size().width() - 420;
|
||||
int maxLabelWidth = freeWidth>=0?freeWidth:0;
|
||||
currentFolder->setMaximumWidth(maxLabelWidth);
|
||||
|
||||
QFontMetrics metrix(currentFolder->font());
|
||||
QString clippedText = metrix.elidedText(currentFolderName, Qt::ElideRight, maxLabelWidth);
|
||||
|
||||
currentFolder->setText(clippedText);
|
||||
|
||||
currentFolder->move((width()-currentFolder->width())/2,(height()-currentFolder->height())/2);
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ private:
|
||||
QHBoxLayout * mainLayout;
|
||||
|
||||
QLabel * currentFolder;
|
||||
QString currentFolderName;
|
||||
|
||||
void addDivider();
|
||||
void addWideDivider();
|
||||
|
Reference in New Issue
Block a user