1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-17 03:45:56 +01:00

Fix the background color of the query term scroll area on OS X

This commit is contained in:
David Sansome 2012-11-03 18:04:52 -07:00
parent 5bdfa1573f
commit eed126f7cd
2 changed files with 13 additions and 11 deletions

View File

@ -19,6 +19,11 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<property name="styleSheet">
<string notr="true">#terms_scroll_area, #terms_scroll_area_content {
background: transparent;
}</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>
@ -69,11 +74,8 @@
<string>Search terms</string> <string>Search terms</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_5">
<property name="margin">
<number>9</number>
</property>
<item> <item>
<widget class="QScrollArea" name="terms_scrollArea"> <widget class="QScrollArea" name="terms_scroll_area">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -86,13 +88,13 @@
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<widget class="QWidget" name="terms_scrollArea_content"> <widget class="QWidget" name="terms_scroll_area_content">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>422</width> <width>418</width>
<height>264</height> <height>251</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">

View File

@ -108,12 +108,12 @@ int QueryWizardPlugin::CreatePages(QWizard* wizard, int finish_page_id) {
connect(search_page_->new_term_, SIGNAL(Clicked()), SLOT(AddSearchTerm())); connect(search_page_->new_term_, SIGNAL(Clicked()), SLOT(AddSearchTerm()));
// Add an empty initial term // Add an empty initial term
search_page_->layout_ = static_cast<QVBoxLayout*>(search_page_->ui_->terms_scrollArea_content->layout()); search_page_->layout_ = static_cast<QVBoxLayout*>(search_page_->ui_->terms_scroll_area_content->layout());
search_page_->layout_->addWidget(search_page_->new_term_); search_page_->layout_->addWidget(search_page_->new_term_);
AddSearchTerm(); AddSearchTerm();
// Ensure that the terms are scrolled to the bottom when a new one is added // Ensure that the terms are scrolled to the bottom when a new one is added
connect(search_page_->ui_->terms_scrollArea->verticalScrollBar(), SIGNAL(rangeChanged(int,int)), this, SLOT(MoveTermListToBottom(int, int))); connect(search_page_->ui_->terms_scroll_area->verticalScrollBar(), SIGNAL(rangeChanged(int,int)), this, SLOT(MoveTermListToBottom(int, int)));
// Add the preview widget at the bottom of the search terms page // Add the preview widget at the bottom of the search terms page
QVBoxLayout* terms_page_layout = static_cast<QVBoxLayout*>(search_page_->layout()); QVBoxLayout* terms_page_layout = static_cast<QVBoxLayout*>(search_page_->layout());
@ -299,7 +299,7 @@ Search QueryWizardPlugin::MakeSearch() const {
void QueryWizardPlugin::SearchTypeChanged() { void QueryWizardPlugin::SearchTypeChanged() {
const bool all = search_page_->ui_->type->currentIndex() == 2; const bool all = search_page_->ui_->type->currentIndex() == 2;
search_page_->ui_->terms_scrollArea_content->setEnabled(!all); search_page_->ui_->terms_scroll_area_content->setEnabled(!all);
UpdateTermPreview(); UpdateTermPreview();
} }
@ -308,7 +308,7 @@ void QueryWizardPlugin::MoveTermListToBottom(int min, int max) {
Q_UNUSED(min); Q_UNUSED(min);
// Only scroll to the bottom if a new term is added // Only scroll to the bottom if a new term is added
if (previous_scrollarea_max_ < max) if (previous_scrollarea_max_ < max)
search_page_->ui_->terms_scrollArea->verticalScrollBar()->setValue(max); search_page_->ui_->terms_scroll_area->verticalScrollBar()->setValue(max);
previous_scrollarea_max_ = max; previous_scrollarea_max_ = max;
} }