1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-31 19:45:31 +01:00

working on making disable for library filter widget work on MacOS (Updates issue #1396)

This commit is contained in:
Paweł Bara 2011-02-02 16:46:57 +00:00
parent 8aedda1795
commit ce104b9cf4
4 changed files with 17 additions and 3 deletions

View File

@ -195,8 +195,7 @@ void LibraryFilterWidget::SetFilterHint(const QString& hint) {
void LibraryFilterWidget::SetDuplicatesOnly(bool duplicates_only) {
// no filtering in duplicates_only mode
filter_->clear();
// TODO: won't work on Mac
ui_->filter->setEnabled(!duplicates_only);
filter_->set_enabled(!duplicates_only);
model_->SetFilterDuplicatesOnly(duplicates_only);
}

View File

@ -43,6 +43,8 @@ public:
virtual void set_hint(const QString& hint) = 0;
virtual void clear_hint() = 0;
virtual void set_enabled(bool enabled) = 0;
protected:
QWidget* widget_;
};
@ -96,6 +98,7 @@ public:
void set_focus() { QLineEdit::setFocus(); }
QString text() const { return QLineEdit::text(); }
void set_text(const QString& text) { QLineEdit::setText(text); }
void set_enabled(bool enabled) { QLineEdit::setEnabled(enabled); }
protected:
void paintEvent(QPaintEvent*);
@ -119,6 +122,7 @@ public:
void set_focus() { QPlainTextEdit::setFocus(); }
QString text() const { return QPlainTextEdit::toPlainText(); }
void set_text(const QString& text) { QPlainTextEdit::setPlainText(text); }
void set_enabled(bool enabled) { QPlainTextEdit::setEnabled(enabled); }
protected:
void paintEvent(QPaintEvent*);
@ -146,6 +150,7 @@ public:
void set_focus() { QSpinBox::setFocus(); }
QString text() const { return QSpinBox::text(); }
void set_text(const QString& text) { QSpinBox::setValue(text.toInt()); }
void set_enabled(bool enabled) { QSpinBox::setEnabled(enabled); }
protected:
void paintEvent(QPaintEvent*);

View File

@ -42,6 +42,8 @@ class MacLineEdit : public QMacCocoaViewContainer, public LineEditInterface {
QString text() const;
void set_focus() {}
void set_enabled(bool enabled);
signals:
void textChanged(const QString& text);
void textEdited(const QString& text);

View File

@ -39,6 +39,8 @@ class SearchTargetWrapper {
void SetHint(const QString& hint);
void setEnabled(bool enabled);
private:
NSSearchField* search_;
SearchTarget* target_;
@ -88,7 +90,9 @@ void SearchTargetWrapper::SetHint(const QString& hint) {
[t release];
}
void SearchTargetWrapper::SetEnabled(bool enabled) {
// TODO: implement this!
}
MacLineEdit::MacLineEdit(QWidget* parent)
: QMacCocoaViewContainer(0, parent),
@ -125,6 +129,10 @@ void MacLineEdit::set_text(const QString& text) {
wrapper_->setText(text);
}
void set_enabled(bool enabled) {
wrapper_->setEnabled(enabled);
}
void MacLineEdit::set_hint(const QString& hint) {
wrapper_->SetHint(hint);
}