#include "iconutils.h"
#include "mediaview.h"
#include "videosource.h"
-#include "iconutils.h"
+#include "fontutils.h"
SidebarHeader::SidebarHeader(QWidget *parent) : QToolBar(parent) { }
addWidget(spacerWidget);
}
-QSize SidebarHeader::minimumSizeHint (void) const {
- return(QSize(160, QFontMetrics(font()).height() * 1.9));
+QSize SidebarHeader::minimumSizeHint() const {
+ return QSize(160, QFontMetrics(font()).height() * 1.9);
}
void SidebarHeader::updateInfo() {
if (title.isEmpty()) return;
QPainter p(this);
p.setPen(Qt::white);
+ p.setFont(FontUtils::small());
const QRect r = rect();
QString t = title;
QRect textBox = p.boundingRect(r, Qt::AlignCenter, t);
int i = 1;
- static const int margin = 50;
+ const int margin = forwardAction->isVisible() ? 45 : 20;
while (textBox.width() > r.width() - margin*2 && t.length() > 3) {
t = t.left(t.length() - i).trimmed() + QLatin1String("...");
textBox = p.boundingRect(r, Qt::AlignCenter, t);
void setTitle(const QString &title);
QAction *backAction;
- QAction * forwardAction;
+ QAction *forwardAction;
QString title;
QList<QAction*> videoSourceActions;
};