diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-04-10 17:24:13 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-04-10 22:24:14 +0900 |
| commit | 3114e19a2e14ae2a2d5b0f5b1bb91688391d6adc (patch) | |
| tree | 15618940765021dab5c86f0f32e466873b9acc11 | |
| parent | 65c5f44695e5393cc03faa75688f76bffe5b757c (diff) | |
| download | tdetoys-3114e19a.tar.gz tdetoys-3114e19a.zip | |
kteatime: improve layout of the configuration dialog
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
| -rw-r--r-- | kteatime/toplevel.cpp | 58 | ||||
| -rw-r--r-- | kteatime/toplevel.h | 1 |
2 files changed, 36 insertions, 23 deletions
diff --git a/kteatime/toplevel.cpp b/kteatime/toplevel.cpp index 0944d3c..4e9f5ad 100644 --- a/kteatime/toplevel.cpp +++ b/kteatime/toplevel.cpp @@ -655,6 +655,11 @@ void TopLevel::downButtonClicked() { enable_controls(); } +void TopLevel::eventEnableToggled(bool on) +{ + btn_conf->setEnabled(on); +} + void TopLevel::popupEnableToggled(bool on) { resetOnPopupEnable->setEnabled(on); @@ -747,6 +752,8 @@ void TopLevel::config() TQHBox *propbox = new TQHBox(editgroup); + // FIXME: - must enforce correct vertical alignment of each label-editor pair + // (better use one HBox for each label-editor pair?) TQVBox *propleft = new TQVBox(propbox); TQVBox *propright = new TQVBox(propbox); nameEdit = new TQLineEdit(propright); @@ -763,41 +770,45 @@ void TopLevel::config() connect(timeEdit, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(spinBoxValueChanged(int))); /* bottom - timeout actions */ - TQGroupBox *actiongroup = new TQGroupBox(5,TQt::Vertical, i18n("Actions"), page); - top_box->addWidget(actiongroup, 0, 0); - - TQWidget *actionconf_widget = new TQWidget(actiongroup); - TQBoxLayout *actionconf_hbox = new TQHBoxLayout(actionconf_widget); - btn_conf = new TQPushButton(i18n("Configure Events..."), actionconf_widget); - actionconf_hbox->addWidget(btn_conf); + TQGridLayout *actionsGrid = new TQGridLayout(top_box, 5, 2, 5); + TQLabel *actionsLabel = new TQLabel(i18n("Actions"), page); + TQFont actionsLblFont = actionsLabel->font(); + actionsLblFont.setBold(true); + actionsLabel->setFont(actionsLblFont); + actionsGrid->addMultiCellWidget(actionsLabel, 0, 0, 0, 1); + + eventEnable = new TQCheckBox(i18n("Event"), page); + TQToolTip::add(eventEnable, i18n("Enable events when the tea is ready")); + connect(eventEnable, TQ_SIGNAL(toggled(bool)), TQ_SLOT(eventEnableToggled(bool))); + actionsGrid->addWidget(eventEnable, 1, 0); + + btn_conf = new TQPushButton(i18n("Configure Events..."), page); + btn_conf->setFixedSize(btn_conf->sizeHint()); connect(btn_conf, TQ_SIGNAL(clicked()), TQ_SLOT(confButtonClicked())); - actionconf_hbox->addStretch(10); + actionsGrid->addWidget(btn_conf, 1, 1); - eventEnable = new TQCheckBox(i18n("Event"), actiongroup); - eventEnable->setFixedHeight(eventEnable->sizeHint().height()); - TQHBox *popupBox = new TQHBox(actiongroup); - popupEnable = new TQCheckBox(i18n("Popup"), popupBox); - popupEnable->setFixedHeight(popupEnable->sizeHint().height()); + popupEnable = new TQCheckBox(i18n("Popup"), page); TQToolTip::add(popupEnable, i18n("Show a popup notification when the tea is ready")); connect(popupEnable, TQ_SIGNAL(toggled(bool)), TQ_SLOT(popupEnableToggled(bool))); + actionsGrid->addWidget(popupEnable, 2, 0); - resetOnPopupEnable = new TQCheckBox(i18n("Reset on popup click"), popupBox); - resetOnPopupEnable->setFixedHeight(resetOnPopupEnable->sizeHint().height()); + resetOnPopupEnable = new TQCheckBox(i18n("Reset on popup click"), page); TQToolTip::add(resetOnPopupEnable, i18n("Reset tea when the popup notification is clicked")); + actionsGrid->addWidget(resetOnPopupEnable, 2, 1); - TQHBox *actionbox = new TQHBox(actiongroup); - actionEnable = new TQCheckBox(actionbox); -// FIXME: add text to this line: -// TQLabel *actionLabel = new TQLabel(i18n("Execute: "), actiongroup); - actionEdit = new TQLineEdit(actionbox); + actionEnable = new TQCheckBox(i18n("Command"), page); + TQToolTip::add(actionEnable, i18n("Run a command when the tea is ready")); + connect(actionEnable, TQ_SIGNAL(toggled(bool)), TQ_SLOT(actionEnableToggled(bool))); + actionsGrid->addWidget(actionEnable, 3, 0); + + actionEdit = new TQLineEdit(page); actionEdit->setFixedHeight(actionEdit->sizeHint().height()); TQToolTip::add(actionEdit, i18n("Enter command here; '%t' will be replaced with name of steeping tea")); - connect(actionEnable, TQ_SIGNAL(toggled(bool)), TQ_SLOT(actionEnableToggled(bool))); + actionsGrid->addWidget(actionEdit, 3, 1); // single checkbox visEnable = new TQCheckBox(i18n("Visualize progress in icon tray"), page); - top_box->addWidget(visEnable, 0, 0); - + actionsGrid->addMultiCellWidget(visEnable, 4, 4, 0, 1); // let listbox claim all remaining vertical space top_box->setStretchFactor(box, 10); @@ -829,6 +840,7 @@ void TopLevel::config() // ------------------------- eventEnable->setChecked(useNotify); + btn_conf->setEnabled(useNotify); popupEnable->setChecked(usePopup); resetOnPopupEnable->setChecked(useResetOnPopup); resetOnPopupEnable->setEnabled(usePopup); diff --git a/kteatime/toplevel.h b/kteatime/toplevel.h index ca3e592..fafbe7c 100644 --- a/kteatime/toplevel.h +++ b/kteatime/toplevel.h @@ -83,6 +83,7 @@ private slots: void disable_properties(); void enable_properties(); void enable_controls(); + void eventEnableToggled(bool on); void popupEnableToggled(bool on); void actionEnableToggled(bool on); |
