TransmitTabWidget::TransmitTabWidget(QWidget *parent) : QTabWidget(parent) , set(Settings::instance()) , m_minimumWidgetWidth(set->getMinimumWidgetWidth()) , m_minimumGroupBoxWidth(set->getMinimumGroupBoxWidth()) { setStyleSheet(set->getTabWidgetStyle()); //setMinimumWidth(m_minimumWidgetWidth); //setMaximumWidth (247); setContentsMargins(4, 4, 4, 0); setMouseTracking(true); m_transmitOptionsWidget = new TransmitOptionsWidget(this); m_transmitPAWidget = new TransmitPAWidget(this); this->addTab(m_transmitOptionsWidget, "Options"); this->addTab(m_transmitPAWidget, "PA Settings"); if (!set->getPenelopePresence() && !set->getPennyLanePresence() && !QSDR::Hermes) { setTabEnabled(1, false); // setTabEnabled(2, false); // setTabEnabled(3, false); } // if (!set->getAlexPresence()) // setTabEnabled(4, false); setupConnections(); }
void TextSymbolSettings::ocadCompatibilityButtonClicked(bool checked) { if (!react_to_changes) return; setTabEnabled(indexOf(ocad_compat_widget), checked); updateCompatibilityCheckEnabled(); }
void TextSymbolSettings::framingCheckClicked(bool checked) { if (!react_to_changes) return; setTabEnabled(indexOf(framing_widget), checked); symbol->framing = checked; emit propertiesModified(); }
void EditorMenuManager::moveTab(eItems item) { Rect rect = VisibleRect::getVisibleRect(); float durationMove = 0.3; auto menu = dynamic_cast<EditorMenuItem*>(this->getChildByTag(item)); bool enabled = menu->getTabEnabled(); for (Vector<Node*>::iterator it = this->getChildren().begin(); it != this->getChildren().end(); ++it) { if (enabled) { if ((static_cast<Node*>(*it))->getTag() == BACK) { // Back button (static_cast<Node*>(*it))->runAction(MoveTo::create(durationMove, Point((rect.getMaxX() - (rect.getMaxX() / 17)), (rect.getMaxY() - (rect.getMaxY() / 12))))); } else if ((static_cast<Node*>(*it))->getTag() == SAVE) { // Save button (static_cast<Node*>(*it))->runAction(MoveTo::create(durationMove, Point((rect.getMaxX() - (rect.getMaxX() / 8.5)), (rect.getMaxY() - (rect.getMaxY() / 12))))); } else { (static_cast<Node*>(*it))->runAction(MoveTo::create(durationMove, Point(0, rect.getMaxY()))); } } else { if (*it == menu) { menu->runAction(MoveTo::create(durationMove, Point(0, rect.getMaxY() * 0.75f))); } else if ((static_cast<Node*>(*it))->getTag() == BACK) { // Back button (static_cast<Node*>(*it))->runAction(MoveTo::create(durationMove, Point((rect.getMaxX() - (rect.getMaxX() / 17)), rect.getMaxY() * 1.25f))); } else if ((static_cast<Node*>(*it))->getTag() == SAVE) { // Save button (static_cast<Node*>(*it))->runAction(MoveTo::create(durationMove, Point((rect.getMaxX() - (rect.getMaxX() / 8.5)), rect.getMaxY() * 1.25f))); } else { (static_cast<Node*>(*it))->runAction(MoveTo::create(durationMove, Point(0, rect.getMaxY() * 1.25f))); } } } menu->setTabEnabled(!enabled); }
MainTabWidget::MainTabWidget(QWidget *parent) : QTabWidget(parent), ui(new Ui::MainTabWidget), m_loading(true) { ui->setupUi(this); auto addTabBtn = new QToolButton(this); addTabBtn->setIcon(QIcon(":/gfx/list-add.png")); addTabBtn->setToolTip(tr("Open a new tab")); connect(addTabBtn, SIGNAL(clicked()), this, SLOT(addNewTab())); int i = addTab(new QLabel("Add tabs by pressing \"+\""), QString()); setTabEnabled(i, false); tabBar()->setTabButton(i, QTabBar::RightSide, addTabBtn); load(); connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int))); connect(this, SIGNAL(currentChanged(int)), this, SLOT(tabChange(int))); connect(tabBar(), SIGNAL(tabMoved(int,int)), this, SLOT(handleTabMove(int,int))); }
void TransmitTabWidget::setPennyPresence(bool value) { setTabEnabled(1, value); // setTabEnabled(2, value); // setTabEnabled(3, value); }