1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-25 13:08:34 +01:00

Smart playworks fit on smaller screens

This commit is contained in:
dmdmdm 2020-05-26 15:30:24 -04:00 committed by John Maguire
parent 54f200d9b9
commit 5899f68e2f
2 changed files with 44 additions and 7 deletions

View File

@ -11,7 +11,7 @@
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -24,8 +24,17 @@
background: transparent;
}</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,5,1">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -67,7 +76,7 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>300</height>
<height>200</height>
</size>
</property>
<property name="title">
@ -93,8 +102,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>418</width>
<height>251</height>
<width>420</width>
<height>182</height>
</rect>
</property>
<property name="sizePolicy">
@ -104,7 +113,16 @@
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>

View File

@ -118,6 +118,7 @@ int QueryWizardPlugin::CreatePages(QWizard* wizard, int finish_page_id) {
search_page_->preview_ = new SearchPreview(search_page_);
search_page_->preview_->set_application(app_);
search_page_->preview_->set_library(library_);
search_page_->preview_->setMinimumHeight(100);
terms_page_layout->addWidget(search_page_->preview_);
// Add sort field texts
@ -151,6 +152,24 @@ int QueryWizardPlugin::CreatePages(QWizard* wizard, int finish_page_id) {
SLOT(UpdateSortPreview()));
connect(sort_ui_->random, SIGNAL(toggled(bool)), SLOT(UpdateSortPreview()));
// Adjust height, if necessary
/*
QScreen *scn = QGuiApplication::primaryScreen();
QRect scnGeo = scn->availableGeometry();
const int scnHeight = scnGeo.height();
//QRect pgeGeo = search_page_->geometry();
const int pgeHeight = search_page_->height();
printf("djm: pgeHeight=%d, scnHeight=%d\n", pgeHeight, scnHeight);
if (pgeHeight > scnHeight) {
printf("djm: too tall\n");
const int pgeWidth = search_page_->width();
search_page_->resize(pgeWidth, scnHeight);
}
else {
printf("djm: OK tall\n");
}
*/
// Configure the page text
search_page_->setTitle(tr("Search terms"));
search_page_->setSubTitle(