From 9fcf15a06b9ec422dbad53508e8ce71d2d4145c3 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 13 Jan 2009 09:59:22 +0000 Subject: A huge amount of changes, based on the results of two usertest. The changes are contained (but not limited to) in the following list: - Make disabled widgets ignored in validation test. - Do not commit values of disabled widgets to the database. - Make storechildren attribute on metawidget, that enables storing of the child widgets in the database. - Implement LUA resume generator. - Make language attribute on resume tag, and switch parser (format/LUA). - Case insensitive search in combobox. - Click on macro name or line, expands macro. - Greyed out widgets in AltComboBox should be hidden instead. - Keyboard 'delete' should delete item from multilist. - "Commit" button needs to be more visible? Icon? - Upon opening of a second macro, the first macro should indicate itself as 'not saved'. - After 'add' in multilist, the input widgets should be reset. - First widget in a macro should have keyboard focus after expansion. - "Endnu ikke udfyldt" needs to be more clear (darker). - Meta widgets must recurse the isValid() call to its children. - Greyed out widgets must be hidden. - Multilist should be read as a list prior to its input fields. - Visible field on widgets. Hides a widget without disabling it. --- client/macrodrawer.cc | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 client/macrodrawer.cc (limited to 'client/macrodrawer.cc') diff --git a/client/macrodrawer.cc b/client/macrodrawer.cc new file mode 100644 index 0000000..97868f8 --- /dev/null +++ b/client/macrodrawer.cc @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * macrodrawer.cc + * + * Tue Jan 6 15:49:48 CET 2009 + * Copyright 2009 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Pracro. + * + * Pracro is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Pracro is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Pracro; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#include "macrodrawer.h" + +#include + +MacroDrawer::MacroDrawer(MacroWindow *p, QString title) +{ + installEventFilter(this); + mw = p; + + if(!mw->isstatic) setTitle(" " + title); + setFlat(true); + + { + QFont f = font(); + f.setItalic(true); + setFont(f); + } + + if(!mw->isstatic) { + QPushButton *b = new QPushButton("±", this); + b->setFixedSize(16,16); + b->move(0,0); + { + QFont f = b->font(); + f.setBold(false); + f.setItalic(false); + b->setFont(f); + } + + connect(b, SIGNAL(clicked()), mw, SLOT(toggleMacro())); + } +} + +bool MacroDrawer::eventFilter(QObject *obj, QEvent *event) +{ + if(event->type() == QEvent::MouseButtonRelease) { + QMouseEvent *mouseEvent = static_cast(event); + if(mouseEvent->y() < 16) mw->toggleMacro(); // Only activate when clicking the top. + } + return QObject::eventFilter(obj, event); +} -- cgit v1.2.3