root/trunk/qt4-gui/src/widgets/skinnablecombobox.cpp

Revision 5837, 1.5 kB (checked in by eugene, 13 months ago)

P.S. Happy recompiling ;-)

Line 
1// -*- c-basic-offset: 2 -*-
2/*
3 * This file is part of Licq, an instant messaging client for UNIX.
4 * Copyright (C) 2007 Licq developers
5 *
6 * Licq is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * Licq is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Licq; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19 */
20
21#include "skinnablecombobox.h"
22
23#include "config/skin.h"
24
25using namespace LicqQtGui;
26
27SkinnableComboBox::SkinnableComboBox(const Config::ComboSkin& skin, QWidget* parent)
28  : QComboBox(parent)
29{
30  applySkin(skin);
31}
32
33SkinnableComboBox::SkinnableComboBox(QWidget* parent)
34  : QComboBox(parent)
35{
36}
37
38void SkinnableComboBox::applySkin(const Config::ComboSkin& skin)
39{
40  // Set colors
41  QPalette pal;
42  if (skin.background.isValid())
43  {
44    pal.setColor(QPalette::Base, skin.background);
45    pal.setColor(QPalette::Button, skin.background);
46  }
47  if (skin.foreground.isValid())
48  {
49    pal.setColor(QPalette::Text, skin.foreground);
50    pal.setColor(QPalette::ButtonText, skin.foreground);
51  }
52  setPalette(pal);
53}
Note: See TracBrowser for help on using the browser.