various UI reimplementations from 0.1.x

This commit is contained in:
itsmattkc
2019-09-26 03:49:49 +10:00
parent c19718a4a5
commit 56e3fd41e5
70 changed files with 2056 additions and 1483 deletions
@@ -36,7 +36,6 @@ ProjectExplorerNavigation::ProjectExplorerNavigation(QWidget *parent) :
// Create "directory up" button
dir_up_btn_ = new QPushButton(this);
dir_up_btn_->setEnabled(false);
dir_up_btn_->setIcon(olive::icon::DirUp);
dir_up_btn_->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
layout->addWidget(dir_up_btn_);
connect(dir_up_btn_, SIGNAL(clicked(bool)), this, SIGNAL(DirectoryUpClicked()));
@@ -49,14 +48,12 @@ ProjectExplorerNavigation::ProjectExplorerNavigation(QWidget *parent) :
// Create size slider
size_slider_ = new QSlider(this);
size_slider_->setOrientation(Qt::Horizontal);
size_slider_->setMinimum(olive::kProjectIconSizeMinimum);
size_slider_->setMaximum(olive::kProjectIconSizeMaximum);
size_slider_->setValue(olive::kProjectIconSizeDefault);
size_slider_->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
layout->addWidget(size_slider_);
connect(size_slider_, SIGNAL(valueChanged(int)), this, SIGNAL(SizeChanged(int)));
Retranslate();
UpdateIcons();
}
void ProjectExplorerNavigation::set_text(const QString &s)
@@ -78,6 +75,8 @@ void ProjectExplorerNavigation::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
Retranslate();
} else if (e->type() == QEvent::StyleChange) {
UpdateIcons();
}
QWidget::changeEvent(e);
}
@@ -86,3 +85,11 @@ void ProjectExplorerNavigation::Retranslate()
{
dir_up_btn_->setToolTip(tr("Go to parent folder"));
}
void ProjectExplorerNavigation::UpdateIcons()
{
dir_up_btn_->setIcon(olive::icon::DirUp);
size_slider_->setMinimum(olive::kProjectIconSizeMinimum);
size_slider_->setMaximum(olive::kProjectIconSizeMaximum);
size_slider_->setValue(olive::kProjectIconSizeDefault);
}