Formatting
This commit is contained in:
@@ -38,16 +38,14 @@ BusyIndicator::BusyIndicator(const QString &text, QWidget *parent)
|
||||
label_(nullptr) {
|
||||
|
||||
Init(text);
|
||||
|
||||
}
|
||||
|
||||
BusyIndicator::BusyIndicator(QWidget *parent)
|
||||
: QWidget(parent),
|
||||
movie_(nullptr),
|
||||
label_(nullptr) {
|
||||
: QWidget(parent),
|
||||
movie_(nullptr),
|
||||
label_(nullptr) {
|
||||
|
||||
Init(QString());
|
||||
|
||||
}
|
||||
|
||||
void BusyIndicator::Init(const QString &text) {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
|
||||
ClickableLabel::ClickableLabel(QWidget *parent) : QLabel(parent){}
|
||||
ClickableLabel::ClickableLabel(QWidget *parent) : QLabel(parent) {}
|
||||
|
||||
void ClickableLabel::mousePressEvent(QMouseEvent *event) {
|
||||
emit Clicked();
|
||||
|
||||
@@ -219,7 +219,7 @@ class FancyTabBar : public QTabBar { // clazy:exclude=missing-qobject-macro
|
||||
if (tabWidget->mode() != FancyTabWidget::Mode_LargeSidebar && tabWidget->mode() != FancyTabWidget::Mode_SmallSidebar) {
|
||||
// Cache and hide label text for IconOnlyTabs mode
|
||||
if (tabWidget->mode() == FancyTabWidget::Mode_IconOnlyTabs && labelCache.count() == 0) {
|
||||
for(int i = 0; i < count(); ++i) {
|
||||
for (int i = 0; i < count(); ++i) {
|
||||
labelCache[tabWidget->widget(i)] = tabText(i);
|
||||
setTabToolTip(i, tabText(i));
|
||||
setTabText(i, "");
|
||||
@@ -315,7 +315,7 @@ class FancyTabBar : public QTabBar { // clazy:exclude=missing-qobject-macro
|
||||
p.setFont(boldFont);
|
||||
|
||||
// Text drop shadow color
|
||||
p.setPen(selected ? QColor(255, 255, 255, 160) : QColor(0, 0, 0, 110) );
|
||||
p.setPen(selected ? QColor(255, 255, 255, 160) : QColor(0, 0, 0, 110));
|
||||
p.translate(0, 3);
|
||||
p.drawText(tabrectText, textFlags, tabText(index));
|
||||
|
||||
@@ -338,7 +338,7 @@ class FancyTabBar : public QTabBar { // clazy:exclude=missing-qobject-macro
|
||||
tabrectIcon = tabrectLabel;
|
||||
tabrectIcon.setSize(QSize(tabWidget->iconsize_largesidebar(), tabWidget->iconsize_largesidebar()));
|
||||
// Center the icon
|
||||
const int moveRight = (QTabBar::width() - tabWidget->iconsize_largesidebar() -1) / 2;
|
||||
const int moveRight = (QTabBar::width() - tabWidget->iconsize_largesidebar() - 1) / 2;
|
||||
tabrectIcon.translate(moveRight, 5);
|
||||
}
|
||||
tabIcon(index).paint(&p, tabrectIcon, iconFlags);
|
||||
@@ -346,18 +346,17 @@ class FancyTabBar : public QTabBar { // clazy:exclude=missing-qobject-macro
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class TabData : public QObject { // clazy:exclude=missing-qobject-macro
|
||||
public:
|
||||
TabData(QWidget *widget_view, const QString &name, const QIcon &icon, const QString &label, const int idx, QWidget *parent)
|
||||
: QObject(parent),
|
||||
widget_view_(widget_view),
|
||||
name_(name), icon_(icon),
|
||||
label_(label),
|
||||
index_(idx),
|
||||
page_(new QWidget()) {
|
||||
: QObject(parent),
|
||||
widget_view_(widget_view),
|
||||
name_(name), icon_(icon),
|
||||
label_(label),
|
||||
index_(idx),
|
||||
page_(new QWidget()) {
|
||||
// In order to achieve the same effect as the "Bottom Widget" of the old Nokia based FancyTabWidget a VBoxLayout is used on each page
|
||||
QVBoxLayout *layout = new QVBoxLayout(page_);
|
||||
layout->setSpacing(0);
|
||||
|
||||
@@ -72,7 +72,7 @@ class FancyTabWidget : public QTabWidget {
|
||||
Mode_Tabs,
|
||||
Mode_IconOnlyTabs,
|
||||
Mode_PlainSidebar,
|
||||
};
|
||||
};
|
||||
|
||||
static const int TabSize_LargeSidebarMinWidth;
|
||||
static const int IconSize_LargeSidebar;
|
||||
|
||||
@@ -212,7 +212,7 @@ void FreeSpaceBar::DrawText(QPainter *p, const QRect r) {
|
||||
for (const Label &label : labels) {
|
||||
const bool light = palette().color(QPalette::Base).value() > 128;
|
||||
|
||||
QRect box(x, r.top() + (r.height() - kLabelBoxSize)/2, kLabelBoxSize, kLabelBoxSize);
|
||||
QRect box(x, r.top() + (r.height() - kLabelBoxSize) / 2, kLabelBoxSize, kLabelBoxSize);
|
||||
p->setPen(label.color.darker());
|
||||
p->setBrush(label.color);
|
||||
p->drawRect(box);
|
||||
|
||||
@@ -70,7 +70,7 @@ class GroupedIconView : public QListView {
|
||||
int header_spacing() const { return header_spacing_; }
|
||||
int header_indent() const { return header_indent_; }
|
||||
int item_indent() const { return item_indent_; }
|
||||
const QString &header_text() const { return header_text_;}
|
||||
const QString &header_text() const { return header_text_; }
|
||||
|
||||
void set_header_spacing(const int value) { header_spacing_ = value; }
|
||||
void set_header_indent(const int value) { header_indent_ = value; }
|
||||
|
||||
@@ -198,12 +198,11 @@ void LineEdit::resizeEvent(QResizeEvent *e) {
|
||||
|
||||
|
||||
TextEdit::TextEdit(QWidget *parent)
|
||||
: QPlainTextEdit(parent),
|
||||
ExtendedEditor(this) {
|
||||
: QPlainTextEdit(parent),
|
||||
ExtendedEditor(this) {
|
||||
|
||||
QObject::connect(reset_button_, &QToolButton::clicked, this, &TextEdit::Reset);
|
||||
QObject::connect(this, &TextEdit::textChanged, [this]() { viewport()->update(); }); // To clear the hint
|
||||
|
||||
QObject::connect(this, &TextEdit::textChanged, [this]() { viewport()->update(); }); // To clear the hint
|
||||
}
|
||||
|
||||
void TextEdit::paintEvent(QPaintEvent *e) {
|
||||
@@ -218,11 +217,10 @@ void TextEdit::resizeEvent(QResizeEvent *e) {
|
||||
|
||||
|
||||
SpinBox::SpinBox(QWidget *parent)
|
||||
: QSpinBox(parent),
|
||||
ExtendedEditor(this, 14, false) {
|
||||
: QSpinBox(parent),
|
||||
ExtendedEditor(this, 14, false) {
|
||||
|
||||
QObject::connect(reset_button_, &QToolButton::clicked, this, &SpinBox::Reset);
|
||||
|
||||
}
|
||||
|
||||
void SpinBox::paintEvent(QPaintEvent *e) {
|
||||
@@ -236,10 +234,9 @@ void SpinBox::resizeEvent(QResizeEvent *e) {
|
||||
}
|
||||
|
||||
CheckBox::CheckBox(QWidget *parent)
|
||||
: QCheckBox(parent), ExtendedEditor(this, 14, false) {
|
||||
: QCheckBox(parent), ExtendedEditor(this, 14, false) {
|
||||
|
||||
QObject::connect(reset_button_, &QToolButton::clicked, this, &CheckBox::Reset);
|
||||
|
||||
}
|
||||
|
||||
void CheckBox::paintEvent(QPaintEvent *e) {
|
||||
@@ -258,14 +255,12 @@ QString SpinBox::textFromValue(int val) const {
|
||||
return "-";
|
||||
}
|
||||
return QSpinBox::textFromValue(val);
|
||||
|
||||
}
|
||||
|
||||
RatingBox::RatingBox(QWidget *parent)
|
||||
: RatingWidget(parent),
|
||||
ExtendedEditor(this) {
|
||||
: RatingWidget(parent),
|
||||
ExtendedEditor(this) {
|
||||
|
||||
clear_button_->hide();
|
||||
reset_button_->hide();
|
||||
|
||||
}
|
||||
|
||||
@@ -318,7 +318,9 @@ void PlayingWidget::SetImage(const QImage &image) {
|
||||
DrawContents(&p);
|
||||
p.end();
|
||||
}
|
||||
else { pixmap_previous_track_ = QPixmap(); }
|
||||
else {
|
||||
pixmap_previous_track_ = QPixmap();
|
||||
}
|
||||
|
||||
image_original_ = image;
|
||||
UpdateDetailsText();
|
||||
|
||||
@@ -80,10 +80,9 @@ QRect RatingPainter::Contents(const QRect rect) {
|
||||
const int x = rect.x() + (rect.width() - width) / 2;
|
||||
|
||||
return QRect(x, rect.y(), width, rect.height());
|
||||
|
||||
}
|
||||
|
||||
float RatingPainter::RatingForPos(const QPoint pos, const QRect rect) {
|
||||
float RatingPainter::RatingForPos(const QPoint pos, const QRect rect) {
|
||||
|
||||
const QRect contents = Contents(rect);
|
||||
const float raw = static_cast<float>(pos.x() - contents.left()) / static_cast<float>(contents.width());
|
||||
|
||||
@@ -88,8 +88,8 @@ void TrackSliderPopup::UpdatePixmap() {
|
||||
#else
|
||||
const int text_width = qMax(font_metrics_.width(text_), small_font_metrics_.width(small_text_));
|
||||
#endif
|
||||
const QRect text_rect1(static_cast<int>(kBlurRadius) + kTextMargin, static_cast<int>(kBlurRadius) + kTextMargin, text_width + 2, font_metrics_.height());
|
||||
const QRect text_rect2(static_cast<int>(kBlurRadius) + kTextMargin, text_rect1.bottom(), text_width, small_font_metrics_.height());
|
||||
const QRect text_rect1(static_cast<int>(kBlurRadius) + kTextMargin, static_cast<int>(kBlurRadius) + kTextMargin, text_width + 2, font_metrics_.height());
|
||||
const QRect text_rect2(static_cast<int>(kBlurRadius) + kTextMargin, text_rect1.bottom(), text_width, small_font_metrics_.height());
|
||||
|
||||
const int bubble_bottom = text_rect2.bottom() + kTextMargin;
|
||||
const QRect total_rect(0, 0, text_rect1.right() + static_cast<int>(kBlurRadius) + kTextMargin, static_cast<int>(kBlurRadius) + bubble_bottom + kPointLength);
|
||||
|
||||
@@ -380,7 +380,7 @@ void VolumeSlider::paletteChange(const QPalette&) {
|
||||
generateGradient();
|
||||
}
|
||||
|
||||
QPixmap VolumeSlider::drawVolumePixmap () const {
|
||||
QPixmap VolumeSlider::drawVolumePixmap() const {
|
||||
|
||||
QPixmap pixmap(112, 36);
|
||||
pixmap.fill(Qt::transparent);
|
||||
|
||||
Reference in New Issue
Block a user