mirror of https://github.com/KLayout/klayout.git
As suggested by Eugene: close left/close right added to macro editor's tab tab ... layout views will follow
This commit is contained in:
parent
ab9fe57ec3
commit
35aaf63051
|
|
@ -400,6 +400,12 @@ MacroEditorDialog::MacroEditorDialog (lay::Dispatcher *pr, lym::MacroCollection
|
|||
action = new QAction (tr ("Close All Except Current"), this);
|
||||
connect (action, SIGNAL (triggered ()), this, SLOT (close_all_but_current ()));
|
||||
tabWidget->addAction (action);
|
||||
action = new QAction (tr ("Close All Left"), this);
|
||||
connect (action, SIGNAL (triggered ()), this, SLOT (close_all_left ()));
|
||||
tabWidget->addAction (action);
|
||||
action = new QAction (tr ("Close All Right"), this);
|
||||
connect (action, SIGNAL (triggered ()), this, SLOT (close_all_right ()));
|
||||
tabWidget->addAction (action);
|
||||
|
||||
dbgOn->setEnabled (true);
|
||||
runButton->setEnabled (true);
|
||||
|
|
@ -2264,6 +2270,24 @@ END_PROTECTED
|
|||
|
||||
void
|
||||
MacroEditorDialog::close_all_but_current ()
|
||||
{
|
||||
close_many (0);
|
||||
}
|
||||
|
||||
void
|
||||
MacroEditorDialog::close_all_left ()
|
||||
{
|
||||
close_many (-1);
|
||||
}
|
||||
|
||||
void
|
||||
MacroEditorDialog::close_all_right ()
|
||||
{
|
||||
close_many (1);
|
||||
}
|
||||
|
||||
void
|
||||
MacroEditorDialog::close_many (int r2c)
|
||||
{
|
||||
if (m_in_exec) {
|
||||
return;
|
||||
|
|
@ -2279,9 +2303,14 @@ BEGIN_PROTECTED
|
|||
return;
|
||||
}
|
||||
|
||||
std::set<QWidget *> removed;
|
||||
|
||||
for (int i = tabWidget->count (); i > 0; ) {
|
||||
--i;
|
||||
if (i != ci) {
|
||||
if ((r2c == 0 && i != ci) ||
|
||||
(r2c < 0 && i < ci) ||
|
||||
(r2c > 0 && i > ci)) {
|
||||
removed.insert (tabWidget->widget (i));
|
||||
tabWidget->removeTab (i);
|
||||
}
|
||||
}
|
||||
|
|
@ -2289,7 +2318,7 @@ BEGIN_PROTECTED
|
|||
std::map <lym::Macro *, MacroEditorPage *> new_widgets;
|
||||
|
||||
for (std::map <lym::Macro *, MacroEditorPage *>::iterator p = m_tab_widgets.begin (); p != m_tab_widgets.end (); ++p) {
|
||||
if (cw && p->second == cw) {
|
||||
if (removed.find (p->second) == removed.end ()) {
|
||||
new_widgets.insert (*p);
|
||||
} else {
|
||||
if (p->second) {
|
||||
|
|
|
|||
|
|
@ -214,6 +214,8 @@ private slots:
|
|||
void tab_close_requested (int);
|
||||
void close_all ();
|
||||
void close_all_but_current ();
|
||||
void close_all_left ();
|
||||
void close_all_right ();
|
||||
void replace_mode_button_clicked ();
|
||||
void replace_next_button_clicked ();
|
||||
void replace_all_button_clicked ();
|
||||
|
|
@ -264,6 +266,7 @@ private:
|
|||
void move_subfolder (lym::MacroCollection *source, lym::MacroCollection *target);
|
||||
lay::MacroEditorPage *create_page (lym::Macro *macro);
|
||||
void open_macro (lym::Macro *macro);
|
||||
void close_many (int which_relative_to_current);
|
||||
void ensure_writeable_collection_selected ();
|
||||
void update_console_text ();
|
||||
void start_exec (gsi::Interpreter *interpreter);
|
||||
|
|
|
|||
Loading…
Reference in New Issue