Ejemplo n.º 1
0
void QThemeWidget::setThemeName(const QString & value)
{
    name = value;
    if (isEditable())
    {
        disconnect(nameEdit,SIGNAL(textChanged(QString)),this,SLOT(setThemeName(QString)));
        nameEdit -> setText(name);
        emit widgetChanged();
        connect(nameEdit,SIGNAL(textChanged(QString)),this,SLOT(setThemeName(QString)));
    }
    else
        nameLabel -> setText("<h1>" + name + "</h1>");

}
Ejemplo n.º 2
0
/**
 * Constructor/Destructor.
 */
	Component::Component() 
		: visible(true),			// default to visible
		  valid(false),				// not valid, so the layout manager is called	
		  borderPainted(false),		// don't paint borders
		  focus(false),				// nothing is focused
		  transparency(1.0f),		// solid
		  enabled(true),
		  // vectors missing here
		  parent(0),				// no parent
		  theme(0),
		  background(0),
		  foreground(0),
		  rec(),					// no size
		  border(0),				// no border
		  insets(),					// no insets
		  font(-1),					// font
		  depth(static_cast<float>(1/Component::NORMAL)), // normal depth
		  // componentList missing
		  preferredSize(-1,-1),		// invalid size cache
		  rotation(0.0f)
	{
		setThemeName("Component");
	//	displayList = util::DisplayList::createIndex();
	//	isDisplayListCompiled = false;
		
	}
Ejemplo n.º 3
0
	void Button::init(Icon *icon,const std::string &label)
	{
		setThemeName("Button");
		setDefaultIcon(icon);
		addMouseListener(this);
		addFocusListener(this);
		setText(label);
	}
Ejemplo n.º 4
0
	void ProgressBar::init(int min, int max, int orientation)
	{
		setThemeName("ProgressBar");
		setMinimum(min);
		setMaximum(max);
		setValue(0);
		setOrientation(orientation);
		setStringPainted(true);
	}
Ejemplo n.º 5
0
	void Slider::init(float min, float max, float value, int orientation)
	{
		setMinimum(min);
		setMaximum(max);
		setValue(value);
		setOrientation(orientation);
		adjusting = false;
		knob.addObserver(this);
		//addImpl(&knob,-1);
		setThemeName("Slider");
	}
Ejemplo n.º 6
0
QThemeWidget::QThemeWidget(QWidget *parent) : QFrame(parent)
{
    setFrameShape(QFrame::Box);
    //setStyleSheet("border-width: 2px; border-color: yellow;");
    layout = new QVBoxLayout(this);
    layout_buttons = new QHBoxLayout();
    nameLabel = new QLabel();
    colorButton = new QPushButton(tr("Выбрать цвет..."));
    setImageButton = new QToolButton();
    clearImageButton = new QToolButton();
    nameEdit = new QLineEdit();

    setImageButton -> setIcon(QIcon(":/images/setimage.png"));
    setImageButton -> setToolTip(tr("Установить картинку темы"));
    clearImageButton -> setToolTip(tr("Удалить картинку темы"));
    clearImageButton -> setIcon(QIcon(":/images/clearimage.png"));
    colorButton -> setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Fixed);
    nameEdit -> setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Fixed);
    nameLabel -> setAlignment(Qt::AlignCenter);
    nameLabel -> setWordWrap(true);
    layout -> addWidget(nameLabel);
    layout -> addWidget(nameEdit);
    layout -> addLayout(layout_buttons);
    layout_buttons -> addWidget(colorButton);
    layout_buttons -> addWidget(setImageButton);
    layout_buttons -> addWidget(clearImageButton);
    layout -> setSpacing(1);
    layout -> setMargin(1);
    setThemeColor(palette().background().color());
    setLayout(layout);
    connect(colorButton,SIGNAL(clicked()),this,SLOT(colorChanged()));
    connect(nameEdit,SIGNAL(textChanged(QString)),this,SLOT(setThemeName(QString)));
    connect(setImageButton,SIGNAL(clicked()),this,SLOT(pictureSet()));
    connect(clearImageButton,SIGNAL(clicked()),this,SLOT(pictureClear()));
    setEditable(true);
}
Ejemplo n.º 7
0
	Frame::Frame(int x, int y, int width, int height)
	{
		setBounds(x,y,width,height);
		setThemeName("Frame");
	}