Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert "Fix settings display on macs"
This reverts commit 96ecd53.
  • Loading branch information
jyavenard committed Apr 4, 2014
1 parent ebf79e1 commit d26c359
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 212 deletions.
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/dialogbox.cpp
Expand Up @@ -16,7 +16,7 @@ DialogBox::DialogBox(MythMainWindow *parent, const QString &text,
const char *name)
: MythDialog(parent, name)
{
MythLabel *maintext = new MythLabel(text, this);
QLabel *maintext = new QLabel(text, this);
maintext->setAlignment(Qt::AlignLeft | Qt::AlignTop);
maintext->setWordWrap(true);

Expand Down
7 changes: 4 additions & 3 deletions mythtv/libs/libmyth/mythconfiggroups.cpp
@@ -1,5 +1,6 @@
#include <algorithm>

#include <QGroupBox>
#include <QStackedWidget>

#include "mythconfiggroups.h"
Expand Down Expand Up @@ -144,7 +145,7 @@ QWidget *VerticalConfigurationGroup::configWidget(
QWidget *widget = NULL;
if (uselabel)
{
MythGroupBox *groupbox = new MythGroupBox(parent);
QGroupBox *groupbox = new QGroupBox(parent);
groupbox->setObjectName(QString("VCG(%1)_groupbox").arg(widgetName));
groupbox->setTitle(getLabel());
widget = groupbox;
Expand Down Expand Up @@ -258,7 +259,7 @@ QWidget *HorizontalConfigurationGroup::configWidget(
QWidget *widget = NULL;
if (uselabel)
{
MythGroupBox *groupbox = new MythGroupBox(parent);
QGroupBox *groupbox = new QGroupBox(parent);
groupbox->setObjectName(QString("HCG(%1)_groupbox").arg(widgetName));
groupbox->setTitle(getLabel());
widget = groupbox;
Expand Down Expand Up @@ -308,7 +309,7 @@ QWidget* GridConfigurationGroup::configWidget(
QWidget *widget = NULL;
if (uselabel)
{
MythGroupBox *groupbox = new MythGroupBox(parent);
QGroupBox *groupbox = new QGroupBox(parent);
groupbox->setObjectName(QString("GCG(%1)_groupbox").arg(widgetName));
groupbox->setTitle(getLabel());
widget = groupbox;
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmyth/mythconfiggroups.h
Expand Up @@ -4,6 +4,7 @@
#define MYTH_CONFIG_GROUPS_H

#include <QVBoxLayout>
#include <QGroupBox>

// MythTV headers
#include "mythexp.h"
Expand All @@ -14,7 +15,6 @@
#undef MYTHCONFIG

class QStackedWidget;
class MythGroupBox;

class MPUBLIC ConfigurationGroup : public Setting, public Storage
{
Expand Down Expand Up @@ -93,7 +93,7 @@ class MPUBLIC VerticalConfigurationGroup : public ConfigurationGroup

private:
vector<QWidget*> childwidget;
MythGroupBox *widget;
QGroupBox *widget;
ConfigurationGroup *confgrp;
QVBoxLayout *layout;
};
Expand Down
9 changes: 5 additions & 4 deletions mythtv/libs/libmyth/mythdialogs.cpp
Expand Up @@ -9,6 +9,7 @@ using namespace std;
#include <QDir>
#include <QLayout>
#include <QRegExp>
#include <QLabel>
#include <QPixmap>
#include <QKeyEvent>
#include <QFrame>
Expand Down Expand Up @@ -415,7 +416,7 @@ void MythPopupBox::addWidget(QWidget *widget, bool setAppearance)
widget->setFont(font());
}

if (widget->metaObject()->className() == QString("MythLabel"))
if (widget->metaObject()->className() == QString("QLabel"))
{
QPalette palette;
palette.setColor(widget->foregroundRole(), popupForegroundColor);
Expand All @@ -425,9 +426,9 @@ void MythPopupBox::addWidget(QWidget *widget, bool setAppearance)
vbox->addWidget(widget);
}

MythLabel *MythPopupBox::addLabel(QString caption, LabelSize size, bool wrap)
QLabel *MythPopupBox::addLabel(QString caption, LabelSize size, bool wrap)
{
MythLabel *label = new MythLabel(caption, this);
QLabel *label = new QLabel(caption, this);
switch (size)
{
case Large: label->setFont(defaultBigFont); break;
Expand Down Expand Up @@ -803,7 +804,7 @@ MythProgressDialog::MythProgressDialog(
setGeometry(xoff, yoff, screenwidth - xoff * 2, yoff);
setFixedSize(QSize(screenwidth - xoff * 2, yoff));

msglabel = new MythLabel();
msglabel = new QLabel();
msglabel->setText(message);

QVBoxLayout *vlayout = new QVBoxLayout();
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmyth/mythdialogs.h
Expand Up @@ -3,6 +3,7 @@

#include <QDomElement>
#include <QDialog>
#include <QLabel>
#include <QAbstractButton>
#include <QObject>
#include <QFrame>
Expand All @@ -18,7 +19,6 @@ class MythMediaDevice;
class MythLineEdit;
class MythRemoteLineEdit;
class MythListBox;
class MythLabel;
struct fontProp;
class QVBoxLayout;
class QProgressBar;
Expand Down Expand Up @@ -130,7 +130,7 @@ class MPUBLIC MythPopupBox : public MythDialog

typedef enum { Large, Medium, Small } LabelSize;

MythLabel *addLabel(QString caption, LabelSize size = Medium,
QLabel *addLabel(QString caption, LabelSize size = Medium,
bool wrap = false);

QAbstractButton *addButton(QString caption, QObject *target = NULL,
Expand Down Expand Up @@ -242,7 +242,7 @@ class MPUBLIC MythProgressDialog: public MythDialog
protected:
~MythProgressDialog(); // use deleteLater() instead for thread safety
QProgressBar *progress;
MythLabel *msglabel;
QLabel *msglabel;

private:
void setTotalSteps(int totalSteps);
Expand Down
157 changes: 2 additions & 155 deletions mythtv/libs/libmyth/mythwidgets.cpp
Expand Up @@ -24,9 +24,6 @@ MythComboBox::MythComboBox(bool rw, QWidget *parent, const char *name) :
{
setObjectName(name);
setEditable(rw);
#ifdef Q_OS_MAC
setStyleSheet("QComboBox { font: bold; } ");
#endif
}

MythComboBox::~MythComboBox()
Expand Down Expand Up @@ -134,9 +131,6 @@ void MythComboBox::focusInEvent(QFocusEvent *e)

QPalette palette;
palette.setColor(backgroundRole(), highlight);
#ifdef Q_OS_MAC
palette.setColor(QPalette::HighlightedText, Qt::white);
#endif
setPalette(palette);

if (lineEdit())
Expand Down Expand Up @@ -172,31 +166,6 @@ void MythComboBox::focusOutEvent(QFocusEvent *e)
QComboBox::focusOutEvent(e);
}

MythCheckBox::MythCheckBox(QWidget *parent, const char *name)
: QCheckBox(parent)
{
setObjectName(name);
#ifdef Q_OS_MAC
QPalette p = palette();
p.setColor(QPalette::Active, QPalette::WindowText, Qt::white);
p.setColor(QPalette::Inactive, QPalette::WindowText, Qt::white);
setPalette(p);
#endif
}

MythCheckBox::MythCheckBox(const QString &text,
QWidget *parent, const char *name)
: QCheckBox(text, parent)
{
setObjectName(name);
#ifdef Q_OS_MAC
QPalette p = palette();
p.setColor(QPalette::Active, QPalette::WindowText, Qt::white);
p.setColor(QPalette::Inactive, QPalette::WindowText, Qt::white);
setPalette(p);
#endif
};

void MythCheckBox::keyPressEvent(QKeyEvent* e)
{
bool handled = false;
Expand Down Expand Up @@ -238,38 +207,17 @@ void MythCheckBox::focusInEvent(QFocusEvent *e)
QColor highlight = palette().color(QPalette::Highlight);
QPalette palette;
palette.setColor(backgroundRole(), highlight);
#ifdef Q_OS_MAC
palette.setColor(QPalette::Active, QPalette::WindowText, Qt::white);
palette.setColor(QPalette::Inactive, QPalette::WindowText, Qt::white);
#endif
setPalette(palette);

QCheckBox::focusInEvent(e);
}

void MythCheckBox::focusOutEvent(QFocusEvent *e)
{
QPalette palette;
#ifdef Q_OS_MAC
palette.setColor(QPalette::Active, QPalette::WindowText, Qt::white);
palette.setColor(QPalette::Inactive, QPalette::WindowText, Qt::white);
#endif
setPalette(palette);
setPalette(QPalette());
QCheckBox::focusOutEvent(e);
}

MythRadioButton:: MythRadioButton(QWidget* parent, const char* name)
: QRadioButton(parent)
{
setObjectName(name);
#ifdef Q_OS_MAC
QPalette p = palette();
p.setColor(QPalette::Active, QPalette::WindowText, Qt::white);
p.setColor(QPalette::Inactive, QPalette::WindowText, Qt::white);
setPalette(p);
#endif
};

void MythRadioButton::keyPressEvent(QKeyEvent* e)
{
bool handled = false;
Expand Down Expand Up @@ -311,38 +259,17 @@ void MythRadioButton::focusInEvent(QFocusEvent *e)

QPalette palette;
palette.setColor(backgroundRole(), highlight);
#ifdef Q_OS_MAC
palette.setColor(QPalette::Active, QPalette::WindowText, Qt::white);
palette.setColor(QPalette::Inactive, QPalette::WindowText, Qt::white);
#endif
setPalette(palette);

QRadioButton::focusInEvent(e);
}

void MythRadioButton::focusOutEvent(QFocusEvent *e)
{
QPalette palette;
#ifdef Q_OS_MAC
palette.setColor(QPalette::Active, QPalette::WindowText, Qt::white);
palette.setColor(QPalette::Inactive, QPalette::WindowText, Qt::white);
#endif
setPalette(palette);

setPalette(QPalette());
QRadioButton::focusOutEvent(e);
}

MythSpinBox::MythSpinBox(QWidget* parent, const char* name,
bool allow_single_step)
: QSpinBox(parent), allowsinglestep(allow_single_step)
{
setObjectName(name);
if (allowsinglestep)
setSingleStep(10);
#ifdef Q_OS_MAC
setStyleSheet("QSpinBox { font: bold; }");
#endif
}

void MythSpinBox::setHelpText(const QString &help)
{
Expand Down Expand Up @@ -404,12 +331,6 @@ void MythSpinBox::focusOutEvent(QFocusEvent *e)
QSpinBox::focusOutEvent(e);
}

MythSlider::MythSlider(QWidget* parent, const char* name)
: QSlider(parent)
{
setObjectName(name);
};

void MythSlider::keyPressEvent(QKeyEvent* e)
{
bool handled = false;
Expand Down Expand Up @@ -471,11 +392,6 @@ MythLineEdit::MythLineEdit(QWidget *parent, const char *name) :
helptext(QString::null), rw(true)
{
setObjectName(name);
#ifdef Q_OS_MAC
setStyleSheet("QLineEdit { font: bold; } "
"QLineEdit:focus { color : white; } "
);
#endif
}

MythLineEdit::MythLineEdit(
Expand All @@ -484,11 +400,6 @@ MythLineEdit::MythLineEdit(
helptext(QString::null), rw(true)
{
setObjectName(name);
#ifdef Q_OS_MAC
setStyleSheet("QLineEdit { font: bold; } "
"QLineEdit:focus { color : white; } "
);
#endif
}

MythLineEdit::~MythLineEdit()
Expand Down Expand Up @@ -1145,26 +1056,6 @@ void MythRemoteLineEdit::backspace()
emit textChanged(toPlainText());
}

MythPushButton::MythPushButton(QWidget *parent, const char *name)
: QPushButton(parent)
{
setObjectName(name);
setCheckable(false);
#ifdef Q_OS_MAC
setStyleSheet("QPushButton:focus { color : white; }");
#endif
}

MythPushButton::MythPushButton(const QString &text, QWidget *parent)
: QPushButton(text, parent)
{
setObjectName("MythPushButton");
setCheckable(false);
#ifdef Q_OS_MAC
setStyleSheet("QPushButton:focus { color : white; }");
#endif
}

MythPushButton::MythPushButton(const QString &ontext, const QString &offtext,
QWidget *parent, bool isOn)
: QPushButton(ontext, parent)
Expand All @@ -1180,9 +1071,6 @@ MythPushButton::MythPushButton(const QString &ontext, const QString &offtext,
setText(offText);

setChecked(isOn);
#ifdef Q_OS_MAC
setStyleSheet("QPushButton:focus { color : white; }");
#endif
}

void MythPushButton::setHelpText(const QString &help)
Expand Down Expand Up @@ -1261,10 +1149,6 @@ void MythPushButton::focusInEvent(QFocusEvent *e)
QColor highlight = palette().color(QPalette::Highlight);
QPalette palette;
palette.setColor(backgroundRole(), highlight);
#ifdef Q_OS_MAC
palette.setColor(QPalette::Active, QPalette::WindowText, Qt::white);
palette.setColor(QPalette::Inactive, QPalette::WindowText, Qt::white);
#endif
setPalette(palette);

QPushButton::focusInEvent(e);
Expand Down Expand Up @@ -1541,41 +1425,4 @@ bool MythListBox::itemVisible(uint row) const
return (widget) ? !isItemHidden(widget) : false;
}

MythLabel::MythLabel(QWidget* parent, const char* name)
: QLabel(parent)
{
setObjectName(name);
#ifdef Q_OS_MAC
setStyleSheet("QLabel { color : white; }");
#endif
}

MythLabel::MythLabel(const QString& text, QWidget* parent, const char* name)
: QLabel(text, parent)
{
setObjectName(name);
#ifdef Q_OS_MAC
setStyleSheet("QLabel { color : white; }");
#endif
}

MythGroupBox::MythGroupBox(QWidget* parent, const char* name)
: QGroupBox(parent)
{
setObjectName(name);
#ifdef Q_OS_MAC
setStyleSheet("QGroupBox { color : white; }");
#endif
}

MythGroupBox::MythGroupBox(const QString& text, QWidget* parent,
const char* name)
: QGroupBox(text, parent)
{
setObjectName(name);
#ifdef Q_OS_MAC
setStyleSheet("QGroupBox { color : white; }");
#endif
}

/* vim: set expandtab tabstop=4 shiftwidth=4: */

0 comments on commit d26c359

Please sign in to comment.