IntegerStyleRange1OutPropertyGeneralWidget::IntegerStyleRange1OutPropertyGeneralWidget(IntegerStyleRange1Out * comp, QWidget *parent, const char *name) : IntegerStyle1OutPropertyGeneralWidget(comp, parent, name) { m_maxValueLabel = new QLabel(i18n("Maximum value: "), this, "MaxValueLabel"); Q_CHECK_PTR(m_maxValueLabel); m_maxValue = new KSimBaseIntEdit(this, "MaxValue"); Q_CHECK_PTR(m_maxValue); QString tip(i18n("The maximum value of the component.")); addToolTip(tip, m_maxValue, m_maxValueLabel); addWhatsThis(tip, m_maxValue, m_maxValueLabel); m_maxValueLabel->setBuddy(m_maxValue); m_minValueLabel = new QLabel(i18n("Minimum value: "), this, "MinValueLabel"); Q_CHECK_PTR(m_minValueLabel); m_minValue = new KSimBaseIntEdit(this, "MinValue"); Q_CHECK_PTR(m_minValue); tip = i18n("The minimum value of the component."); addToolTip(tip, m_minValue, m_minValueLabel); addWhatsThis(tip, m_minValue, m_minValueLabel); m_minValueLabel->setBuddy(m_minValue); // Setup value m_maxValue->setValue(comp->getMaxValue()); m_minValue->setValue(comp->getMinValue()); }
FloatLatchPropertyGeneralWidget::FloatLatchPropertyGeneralWidget(FloatLatch * comp, QWidget *parent, const char *name) : ComponentPropertyGeneralWidget(comp, parent, name) { QString tip; m_min = QMAX ( comp->getInputPack()->getNumberOfNotDeletableConnectors(), comp->getOutputPack()->getNumberOfNotDeletableConnectors()); m_channelsLabel = new QLabel(i18n("Channel count: "), getGrid(), "m_channelsLabel"); CHECK_PTR(m_channelsLabel); m_channels = new QSpinBox(m_min, MAX_CHANNELS, 1, getGrid(), "m_channels"); CHECK_PTR(m_channels); tip = i18n("Change count of channels here."); addToolTip(tip, m_channels, m_channelsLabel); addWhatsThis(tip, m_channels, m_channelsLabel); m_resetValueLabel = new QLabel(i18n("Reset value: "), getGrid(), "m_resetValueLabel"); CHECK_PTR(m_resetValueLabel); m_resetValue = new KSimDoubleEdit(getGrid(), "m_resetValue"); CHECK_PTR(m_resetValue); tip = i18n("Change the reset value of the component here."); addToolTip(tip, m_resetValue, m_resetValueLabel); addWhatsThis(tip, m_resetValue, m_resetValueLabel); // Setup value m_resetValue->setValue(comp->getResetValue()); m_channels->setValue(comp->getInputPack()->getConnectorCount()); }
ConvertBoolFloatPropertyGeneralWidget::ConvertBoolFloatPropertyGeneralWidget(ConvertBoolFloat * comp, QWidget *parent, const char *name) : ComponentPropertyGeneralWidget(comp, parent, name) { QString tip; m_trueValueLabel = new QLabel(i18n("FloatingPoint", "True Value: "), this, "m_trueValueLabel"); Q_CHECK_PTR(m_trueValueLabel); m_trueValue = new KSimDoubleEdit(this, "m_trueValue"); Q_CHECK_PTR(m_trueValue); tip = i18n("FloatingPoint", "Sets the value which represents the true level."); addToolTip(tip, m_trueValue, m_trueValueLabel); addWhatsThis(tip, m_trueValue, m_trueValueLabel); m_trueValueLabel->setBuddy(m_trueValue); m_falseValueLabel = new QLabel(i18n("FloatingPoint", "False Value: "), this, "m_falseValueLabel"); Q_CHECK_PTR(m_falseValueLabel); m_falseValue = new KSimDoubleEdit(this, "m_falseValue"); Q_CHECK_PTR(m_falseValue); tip = i18n("FloatingPoint", "Sets the value which represents the false level."); addToolTip(tip, m_falseValue, m_falseValueLabel); addWhatsThis(tip, m_falseValue, m_falseValueLabel); m_falseValueLabel->setBuddy(m_falseValue); // Setup value m_trueValue->setValue(comp->getTrueValue()); m_falseValue->setValue(comp->getFalseValue()); }
ConvertIntegerBool::PropertyGeneralWidget::PropertyGeneralWidget(ConvertIntegerBool * comp, QWidget *parent, const char *name) : ComponentPropertyGeneralWidget(comp, parent, name) { QString tip; m_trueThresholdLabel = new QLabel(i18n("Integer", "True Threshold: "), this, "m_trueThresholdLabel"); Q_CHECK_PTR(m_trueThresholdLabel); m_trueThreshold = new KSimBaseIntEdit(this, "m_trueThreshold"); Q_CHECK_PTR(m_trueThreshold); tip = i18n("Integer", "Sets the threshold where the converter switch to true."); addToolTip(tip, m_trueThreshold, m_trueThresholdLabel); addWhatsThis(tip, m_trueThreshold, m_trueThresholdLabel); m_trueThresholdLabel->setBuddy(m_trueThreshold); m_falseThresholdLabel = new QLabel(i18n("Integer", "False Threshold: "), this, "m_falseThresholdLabel"); Q_CHECK_PTR(m_falseThresholdLabel); m_falseThreshold = new KSimBaseIntEdit(this, "m_falseThreshold"); Q_CHECK_PTR(m_falseThreshold); tip = i18n("Integer", "Sets the threshold where the converter switch to false."); addToolTip(tip, m_falseThreshold, m_falseThresholdLabel); addWhatsThis(tip, m_falseThreshold, m_falseThresholdLabel); m_falseThresholdLabel->setBuddy(m_falseThreshold); // Setup value m_trueThreshold->setValue(comp->getTrueThreshold()); m_falseThreshold->setValue(comp->getFalseThreshold()); }
ExtConnIntegerIn::PropertyGeneralWidget::PropertyGeneralWidget(ExtConnIntegerIn * comp, QWidget *parent, const char *name) : ExternalConnectorPropertyGeneralWidget(comp, parent, name) { m_defaultValueLabel = new QLabel(i18n("Integer", "Default value:"), this, "m_defaultValueLabel"); Q_CHECK_PTR(m_defaultValueLabel); m_defaultValue = new KSimBaseIntEdit(this, "m_defaultValue"); Q_CHECK_PTR(m_defaultValue); QString tip(i18n("Integer", "Sets the value state of the external connector.\n" "This value is used if the external connector is not connected.")); addToolTip(tip, m_defaultValue, m_defaultValueLabel); addWhatsThis(tip, m_defaultValue, m_defaultValueLabel); m_defaultValueLabel->setBuddy(m_defaultValue); // Setup value m_defaultValue->setValue(getExtConnIn()->getDefaultValue()); }
KCMStyle::KCMStyle( TQWidget* parent, const char* name ) : TDECModule( parent, name ), appliedStyle(NULL) { setQuickHelp( i18n("<h1>Style</h1>" "This module allows you to modify the visual appearance " "of user interface elements, such as the widget style " "and effects.")); m_bEffectsDirty = false; m_bStyleDirty= false; m_bToolbarsDirty = false; TDEGlobal::dirs()->addResourceType("themes", TDEStandardDirs::kde_default("data") + "tdestyle/themes"); TDEAboutData *about = new TDEAboutData( I18N_NOOP("kcmstyle"), I18N_NOOP("TDE Style Module"), 0, 0, TDEAboutData::License_GPL, I18N_NOOP("(c) 2002 Karol Szwed, Daniel Molkentin")); about->addAuthor("Karol Szwed", 0, "*****@*****.**"); about->addAuthor("Daniel Molkentin", 0, "*****@*****.**"); about->addAuthor("Ralf Nolden", 0, "*****@*****.**"); setAboutData( about ); // Setup pages and mainLayout mainLayout = new TQVBoxLayout( this ); tabWidget = new TQTabWidget( this ); mainLayout->addWidget( tabWidget ); page1 = new TQWidget( tabWidget ); page1Layout = new TQVBoxLayout( page1, KDialog::marginHint(), KDialog::spacingHint() ); page2 = new TQWidget( tabWidget ); page2Layout = new TQVBoxLayout( page2, KDialog::marginHint(), KDialog::spacingHint() ); page3 = new TQWidget( tabWidget ); page3Layout = new TQVBoxLayout( page3, KDialog::marginHint(), KDialog::spacingHint() ); // Add Page1 (Style) // ----------------- gbWidgetStyle = new TQGroupBox( i18n("Widget Style"), page1, "gbWidgetStyle" ); gbWidgetStyle->setColumnLayout( 0, Qt::Vertical ); gbWidgetStyle->layout()->setMargin( KDialog::marginHint() ); gbWidgetStyle->layout()->setSpacing( KDialog::spacingHint() ); gbWidgetStyleLayout = new TQVBoxLayout( gbWidgetStyle->layout() ); gbWidgetStyleLayout->setAlignment( Qt::AlignTop ); hbLayout = new TQHBoxLayout( KDialog::spacingHint(), "hbLayout" ); cbStyle = new KComboBox( gbWidgetStyle, "cbStyle" ); cbStyle->setEditable( FALSE ); hbLayout->addWidget( cbStyle ); pbConfigStyle = new TQPushButton( i18n("Con&figure..."), gbWidgetStyle ); pbConfigStyle->setSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Minimum ); pbConfigStyle->setEnabled( FALSE ); hbLayout->addWidget( pbConfigStyle ); gbWidgetStyleLayout->addLayout( hbLayout ); lblStyleDesc = new TQLabel( gbWidgetStyle ); lblStyleDesc->setTextFormat(TQt::RichText); gbWidgetStyleLayout->addWidget( lblStyleDesc ); cbIconsOnButtons = new TQCheckBox( i18n("Sho&w icons on buttons"), gbWidgetStyle ); gbWidgetStyleLayout->addWidget( cbIconsOnButtons ); cbScrollablePopupMenus = new TQCheckBox( i18n("Enable &scrolling in popup menus"), gbWidgetStyle ); gbWidgetStyleLayout->addWidget( cbScrollablePopupMenus ); cbAutoHideAccelerators = new TQCheckBox( i18n("Hide &underlined characters in the menu bar when not in use"), gbWidgetStyle ); gbWidgetStyleLayout->addWidget( cbAutoHideAccelerators ); cbMenuAltKeyNavigation = new TQCheckBox( i18n("&Pressing only the menu bar activator key selects the menu bar"), gbWidgetStyle ); gbWidgetStyleLayout->addWidget( cbMenuAltKeyNavigation ); cbEnableTooltips = new TQCheckBox( i18n("E&nable tooltips"), gbWidgetStyle ); gbWidgetStyleLayout->addWidget( cbEnableTooltips ); cbTearOffHandles = new TQCheckBox( i18n("Show tear-off handles in &popup menus"), gbWidgetStyle ); gbWidgetStyleLayout->addWidget( cbTearOffHandles ); cbTearOffHandles->hide(); // reenable when the corresponding Qt method is virtual and properly reimplemented gbWidgetStyleLayout->addSpacing(10); m_popupMenuDelay = new KIntNumInput(250, gbWidgetStyle); m_popupMenuDelay->setLabel(i18n("Menu popup delay:")); m_popupMenuDelay->setRange(0, 5000, 50); m_popupMenuDelay->setSuffix(i18n(" msec")); m_popupMenuDelay->setSteps(50, 50); gbWidgetStyleLayout->addWidget(m_popupMenuDelay); gbWidgetStyleLayout->addSpacing(10); TQGroupBox *gbPreview = new TQGroupBox( i18n( "Preview" ), page1 ); gbPreview->setColumnLayout( 0, Qt::Vertical ); gbPreview->layout()->setMargin( 0 ); gbPreview->layout()->setSpacing( KDialog::spacingHint() ); gbPreview->setFlat( true ); stylePreview = new StylePreview( gbPreview ); gbPreview->layout()->add( stylePreview ); page1Layout->addWidget( gbWidgetStyle ); page1Layout->addWidget( gbPreview ); // Connect all required stuff connect( cbStyle, TQT_SIGNAL(activated(int)), this, TQT_SLOT(styleChanged()) ); connect( cbStyle, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateConfigButton())); connect( pbConfigStyle, TQT_SIGNAL(clicked()), this, TQT_SLOT(styleSpecificConfig())); // Add Page2 (Effects) // ------------------- cbEnableEffects = new TQCheckBox( i18n("&Enable GUI effects"), page2 ); containerFrame = new TQFrame( page2 ); containerFrame->setFrameStyle( TQFrame::NoFrame | TQFrame::Plain ); containerFrame->setMargin(0); containerLayout = new TQGridLayout( containerFrame, 1, 1, // rows, columns KDialog::marginHint(), KDialog::spacingHint() ); comboComboEffect = new TQComboBox( FALSE, containerFrame ); comboComboEffect->insertItem( i18n("Disable") ); comboComboEffect->insertItem( i18n("Animate") ); lblComboEffect = new TQLabel( i18n("Combobo&x effect:"), containerFrame ); lblComboEffect->setBuddy( comboComboEffect ); containerLayout->addWidget( lblComboEffect, 0, 0 ); containerLayout->addWidget( comboComboEffect, 0, 1 ); comboTooltipEffect = new TQComboBox( FALSE, containerFrame ); comboTooltipEffect->insertItem( i18n("Disable") ); comboTooltipEffect->insertItem( i18n("Animate") ); comboTooltipEffect->insertItem( i18n("Fade") ); lblTooltipEffect = new TQLabel( i18n("&Tool tip effect:"), containerFrame ); lblTooltipEffect->setBuddy( comboTooltipEffect ); containerLayout->addWidget( lblTooltipEffect, 1, 0 ); containerLayout->addWidget( comboTooltipEffect, 1, 1 ); comboRubberbandEffect = new TQComboBox( FALSE, containerFrame ); comboRubberbandEffect->insertItem( i18n("Disable") ); comboRubberbandEffect->insertItem( i18n("Make translucent") ); lblRubberbandEffect = new TQLabel( i18n("&Rubberband effect:"), containerFrame ); lblRubberbandEffect->setBuddy( comboRubberbandEffect ); containerLayout->addWidget( lblRubberbandEffect, 2, 0 ); containerLayout->addWidget( comboRubberbandEffect, 2, 1 ); comboMenuEffect = new TQComboBox( FALSE, containerFrame ); comboMenuEffect->insertItem( i18n("Disable") ); comboMenuEffect->insertItem( i18n("Animate") ); comboMenuEffect->insertItem( i18n("Fade") ); comboMenuEffect->insertItem( i18n("Make Translucent") ); lblMenuEffect = new TQLabel( i18n("&Menu effect:"), containerFrame ); lblMenuEffect->setBuddy( comboMenuEffect ); containerLayout->addWidget( lblMenuEffect, 3, 0 ); containerLayout->addWidget( comboMenuEffect, 3, 1 ); comboMenuHandle = new TQComboBox( FALSE, containerFrame ); comboMenuHandle->insertItem( i18n("Disable") ); comboMenuHandle->insertItem( i18n("Application Level") ); // comboMenuHandle->insertItem( i18n("Enable") ); lblMenuHandle = new TQLabel( i18n("Me&nu tear-off handles:"), containerFrame ); lblMenuHandle->setBuddy( comboMenuHandle ); containerLayout->addWidget( lblMenuHandle, 4, 0 ); containerLayout->addWidget( comboMenuHandle, 4, 1 ); cbMenuShadow = new TQCheckBox( i18n("Menu &drop shadow"), containerFrame ); containerLayout->addWidget( cbMenuShadow, 5, 0 ); // Push the [label combo] to the left. comboSpacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); containerLayout->addItem( comboSpacer, 1, 2 ); // Separator. TQFrame* hline = new TQFrame ( page2 ); hline->setFrameStyle( TQFrame::HLine | TQFrame::Sunken ); // Now implement the Menu Transparency container. menuContainer = new TQFrame( page2 ); menuContainer->setFrameStyle( TQFrame::NoFrame | TQFrame::Plain ); menuContainer->setMargin(0); menuContainerLayout = new TQGridLayout( menuContainer, 1, 1, // rows, columns KDialog::marginHint(), KDialog::spacingHint() ); menuPreview = new MenuPreview( menuContainer, /* opacity */ 90, MenuPreview::Blend ); comboMenuEffectType = new TQComboBox( FALSE, menuContainer ); comboMenuEffectType->insertItem( i18n("Software Tint") ); comboMenuEffectType->insertItem( i18n("Software Blend") ); #ifdef HAVE_XRENDER comboMenuEffectType->insertItem( i18n("XRender Blend") ); #endif // So much stuffing around for a simple slider.. sliderBox = new TQVBox( menuContainer ); sliderBox->setSpacing( KDialog::spacingHint() ); sliderBox->setMargin( 0 ); slOpacity = new TQSlider( 0, 100, 5, /*opacity*/ 90, Qt::Horizontal, sliderBox ); slOpacity->setTickmarks( TQSlider::Below ); slOpacity->setTickInterval( 10 ); TQHBox* box1 = new TQHBox( sliderBox ); box1->setSpacing( KDialog::spacingHint() ); box1->setMargin( 0 ); TQLabel* lbl = new TQLabel( i18n("0%"), box1 ); lbl->setAlignment( AlignLeft ); lbl = new TQLabel( i18n("50%"), box1 ); lbl->setAlignment( AlignHCenter ); lbl = new TQLabel( i18n("100%"), box1 ); lbl->setAlignment( AlignRight ); lblMenuEffectType = new TQLabel( comboMenuEffectType, i18n("Menu trans&lucency type:"), menuContainer ); lblMenuEffectType->setAlignment( AlignBottom | AlignLeft ); lblMenuOpacity = new TQLabel( slOpacity, i18n("Menu &opacity:"), menuContainer ); lblMenuOpacity->setAlignment( AlignBottom | AlignLeft ); menuContainerLayout->addWidget( lblMenuEffectType, 0, 0 ); menuContainerLayout->addWidget( comboMenuEffectType, 1, 0 ); menuContainerLayout->addWidget( lblMenuOpacity, 2, 0 ); menuContainerLayout->addWidget( sliderBox, 3, 0 ); menuContainerLayout->addMultiCellWidget( menuPreview, 0, 3, 1, 1 ); // Layout page2. page2Layout->addWidget( cbEnableEffects ); page2Layout->addWidget( containerFrame ); page2Layout->addWidget( hline ); page2Layout->addWidget( menuContainer ); TQSpacerItem* sp1 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); page2Layout->addItem( sp1 ); // Data flow stuff. connect( cbEnableEffects, TQT_SIGNAL(toggled(bool)), containerFrame, TQT_SLOT(setEnabled(bool)) ); connect( cbEnableEffects, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(menuEffectChanged(bool)) ); connect( slOpacity, TQT_SIGNAL(valueChanged(int)),menuPreview, TQT_SLOT(setOpacity(int)) ); connect( comboMenuEffect, TQT_SIGNAL(activated(int)), this, TQT_SLOT(menuEffectChanged()) ); connect( comboMenuEffect, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(menuEffectChanged()) ); connect( comboMenuEffectType, TQT_SIGNAL(activated(int)), this, TQT_SLOT(menuEffectTypeChanged()) ); connect( comboMenuEffectType, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(menuEffectTypeChanged()) ); // Add Page3 (Miscellaneous) // ------------------------- cbHoverButtons = new TQCheckBox( i18n("High&light buttons under mouse"), page3 ); cbTransparentToolbars = new TQCheckBox( i18n("Transparent tool&bars when moving"), page3 ); TQWidget * dummy = new TQWidget( page3 ); TQHBoxLayout* box2 = new TQHBoxLayout( dummy, 0, KDialog::spacingHint() ); lbl = new TQLabel( i18n("Text pos&ition:"), dummy ); comboToolbarIcons = new TQComboBox( FALSE, dummy ); comboToolbarIcons->insertItem( i18n("Icons Only") ); comboToolbarIcons->insertItem( i18n("Text Only") ); comboToolbarIcons->insertItem( i18n("Text Alongside Icons") ); comboToolbarIcons->insertItem( i18n("Text Under Icons") ); lbl->setBuddy( comboToolbarIcons ); box2->addWidget( lbl ); box2->addWidget( comboToolbarIcons ); TQSpacerItem* sp2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); box2->addItem( sp2 ); page3Layout->addWidget( cbHoverButtons ); page3Layout->addWidget( cbTransparentToolbars ); page3Layout->addWidget( dummy ); // Layout page3. TQSpacerItem* sp3 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); page3Layout->addItem( sp3 ); // Load settings load(); // Do all the setDirty connections. connect(cbStyle, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setStyleDirty())); // Page2 connect( cbEnableEffects, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setEffectsDirty())); connect( cbEnableEffects, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setStyleDirty())); connect( comboTooltipEffect, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setEffectsDirty())); connect( comboRubberbandEffect, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setStyleDirty())); connect( comboComboEffect, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setEffectsDirty())); connect( comboMenuEffect, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setStyleDirty())); connect( comboMenuHandle, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setStyleDirty())); connect( comboMenuEffectType, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setStyleDirty())); connect( slOpacity, TQT_SIGNAL(valueChanged(int)),this, TQT_SLOT(setStyleDirty())); connect( cbMenuShadow, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setStyleDirty())); // Page1 & Page3 connect( cbHoverButtons, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setToolbarsDirty())); connect( cbTransparentToolbars, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setToolbarsDirty())); connect( cbEnableTooltips, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setEffectsDirty())); connect( cbIconsOnButtons, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setEffectsDirty())); connect( cbScrollablePopupMenus,TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setEffectsDirty())); connect( cbAutoHideAccelerators,TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setEffectsDirty())); connect( cbMenuAltKeyNavigation,TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setEffectsDirty())); connect( cbTearOffHandles, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setEffectsDirty())); connect( comboToolbarIcons, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setToolbarsDirty())); connect( m_popupMenuDelay, TQT_SIGNAL(valueChanged(int)),this, TQT_SLOT(setStyleDirty())); addWhatsThis(); // Insert the pages into the tabWidget tabWidget->insertTab( page1, i18n("&Style")); tabWidget->insertTab( page2, i18n("&Effects")); tabWidget->insertTab( page3, i18n("&Toolbar")); //Enable/disable the button for the initial style updateConfigButton(); }
ComponentPropertyStyleWidget::ComponentPropertyStyleWidget(ComponentStyle * comp, QWidget *parent, const char *name) : ComponentPropertyBaseWidget(comp, 1, parent, name) { setCenterColStretch(0); setRightColStretch(1); QString str; QLabel * label; // Color Group m_colorGroup = new QVGroupBox(i18n("Color:"), this, "Style Color Box"); Q_CHECK_PTR(m_colorGroup); // Color Group - Default colors m_defaultColors = new QCheckBox(i18n("Use system colors"), getColorBox(), "Default Colors"); Q_CHECK_PTR(m_defaultColors); str = i18n("Check the box if the component have to use the color scheme of your system."); addToolTip(str, m_defaultColors); addWhatsThis(str, m_defaultColors); // Color Group - Color button group QGrid * colButGrp = new QGrid(2, /*QGrid::Horizontal,*/ getColorBox()); Q_CHECK_PTR(colButGrp); // Color Group - Color button group - Foreground color label = new QLabel(i18n("Foreground Color:"), colButGrp); Q_CHECK_PTR(label); m_foreGround = new KColorButton(colButGrp); Q_CHECK_PTR(m_foreGround); label->setBuddy(m_foreGround); str = i18n("Select the foreground color."); addToolTip(str, m_foreGround, label); addWhatsThis(str, m_foreGround, label); // Color Group - Color button group - Background color label = new QLabel(i18n("Background Color:"), colButGrp); Q_CHECK_PTR(label); m_backGround = new KColorButton(colButGrp); Q_CHECK_PTR(m_backGround); label->setBuddy(m_backGround); str = i18n("Select the background color."); addToolTip(str, m_backGround, label); addWhatsThis(str, m_backGround, label); // Frame Group m_frameGroup = new QVGroupBox(i18n("Frame:"), this, "Style Frame Box"); Q_CHECK_PTR(m_frameGroup); // Frame Group - Frame ena m_enaFrame = new QCheckBox(i18n("Enable frame in user interface"), getFrameBox(), "Frame Ena"); Q_CHECK_PTR(m_enaFrame); str = i18n("Check the box if component have to display a frame."); addToolTip(str, m_enaFrame); addWhatsThis(str, m_enaFrame); // Font Group m_fontGroup = new QVGroupBox(i18n("Font:"), this, "Style Font Box"); Q_CHECK_PTR(m_fontGroup); // Font Group - Default Font m_defaultFont = new QCheckBox(i18n("Use default font"), getFontBox(), "Font default"); Q_CHECK_PTR(m_defaultFont); str = i18n("Check the box if component have to use the default (the application) font."); addToolTip(str, m_defaultFont); addWhatsThis(str, m_defaultFont); // Font Group - Font Dialog Button m_fontButton = new QPushButton(i18n("Select font"), getFontBox(), "Font Button"); Q_CHECK_PTR(m_fontButton); m_exampleFont = new QLabel(getFontBox(), "Font Example"); Q_CHECK_PTR(m_fontButton); //######## Setup values //*** color *** // Ena color box if (!getCompStyle()->isColorAdjustmentEnabled()) getColorBox()->hide(); // def color bool useDefaultColor = !(getCompStyle()->getForegroundColor().isValid() && getCompStyle()->getBackgroundColor().isValid()); m_defaultColors->setChecked(useDefaultColor); // Fore color if (getCompStyle()->getForegroundColor().isValid()) { m_foreGround->setColor(getCompStyle()->getForegroundColor()); } else { m_foreGround->setColor(palette().color(QPalette::Active, QColorGroup::Foreground)); } m_foreGround->setDisabled(useDefaultColor); connect(m_defaultColors, SIGNAL(toggled(bool)), m_foreGround, SLOT(setDisabled(bool))); // Back color if (getCompStyle()->getBackgroundColor().isValid()) { m_backGround->setColor(getCompStyle()->getBackgroundColor()); } else { m_backGround->setColor(palette().color(QPalette::Active, QColorGroup::Background)); } m_backGround->setDisabled(useDefaultColor); connect(m_defaultColors, SIGNAL(toggled(bool)), m_backGround, SLOT(setDisabled(bool))); //*** frame *** // Ena frame box if (!getCompStyle()->isFrameAdjustmentEnabled()) getFrameBox()->hide(); // frame ena m_enaFrame->setChecked(getCompStyle()->isFrameEnabled()); //*** font *** // Ena color box if (!getCompStyle()->isFontAdjustmentEnabled()) getFontBox()->hide(); m_defaultFont->setChecked(getCompStyle()->isDefaultFontEnabled()); m_fontButton->setDisabled(getCompStyle()->isDefaultFontEnabled()); connect(m_defaultFont, SIGNAL(toggled(bool)), m_fontButton, SLOT(setDisabled(bool))); connect(m_fontButton, SIGNAL(clicked()), this, SLOT(slotFontDialog())); m_font = getCompStyle()->getFont(); m_exampleFont->setFont(m_font); m_exampleFont->setText(m_font.family()); connect(m_defaultFont, SIGNAL(toggled(bool)), m_exampleFont, SLOT(setDisabled(bool))); }