StelDialog.hpp   StelDialog.hpp 
skipping to change at line 24 skipping to change at line 24
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _STELDIALOG_HPP_ #ifndef _STELDIALOG_HPP_
#define _STELDIALOG_HPP_ #define _STELDIALOG_HPP_
#include <QObject> #include <QObject>
#include <QGraphicsProxyWidget>
#include <QGraphicsSceneResizeEvent>
#include <QSettings>
#include <QWidget>
#include "StelApp.hpp"
class QAbstractButton; class QAbstractButton;
class QComboBox; class QComboBox;
class QSpinBox; class QSpinBox;
class QDoubleSpinBox; class QDoubleSpinBox;
class QSlider; class QSlider;
class StelAction; class StelAction;
//! Base class for all the GUI windows in Stellarium. //! Base class for all the GUI windows in Stellarium.
//! //!
skipping to change at line 96 skipping to change at line 101
//! if (dialog) //! if (dialog)
//! ui->retranslateUi(dialog); //! ui->retranslateUi(dialog);
//! \endcode //! \endcode
virtual void retranslate() = 0; virtual void retranslate() = 0;
//! On the first call with "true" populates the window contents. //! On the first call with "true" populates the window contents.
void setVisible(bool); void setVisible(bool);
//! Closes the window (the window widget is not deleted, just not vi sible). //! Closes the window (the window widget is not deleted, just not vi sible).
void close(); void close();
//! Adds dialog location to config.ini; should be connected in creat eDialogContent() //! Adds dialog location to config.ini; should be connected in creat eDialogContent()
void handleMovedTo(QPoint newPos); void handleMovedTo(QPoint newPos);
//! Stores dialog sizes into config.ini; should be connected from th
e proxy.
void handleDialogSizeChanged(QSizeF size);
QString getDialogName(){return dialogName;}
signals: signals:
void visibleChanged(bool); void visibleChanged(bool);
protected: protected:
//! Initialize the dialog widgets and connect the signals/slots. //! Initialize the dialog widgets and connect the signals/slots.
virtual void createDialogContent()=0; virtual void createDialogContent()=0;
//! Helper function to connect a checkbox to the StelAction with the specified name //! Helper function to connect a checkbox to the StelAction with the specified name
static void connectCheckBox(QAbstractButton* checkBox,const QString& actionName); static void connectCheckBox(QAbstractButton* checkBox,const QString& actionName);
//! Helper function to connect a checkbox to the given StelAction //! Helper function to connect a checkbox to the given StelAction
skipping to change at line 149 skipping to change at line 157
//! The name should be set in derived classes' constructors and can be used to store and retrieve the panel locations. //! The name should be set in derived classes' constructors and can be used to store and retrieve the panel locations.
QString dialogName; QString dialogName;
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
//! Kinetic scrolling for lists. //! Kinetic scrolling for lists.
void installKineticScrolling(QList<QWidget *> addscroll); void installKineticScrolling(QList<QWidget *> addscroll);
#endif #endif
private slots: private slots:
void updateNightModeProperty(); void updateNightModeProperty();
}; };
class CustomProxy : public QGraphicsProxyWidget
{ private:
Q_OBJECT
public:
CustomProxy(QGraphicsItem *parent = 0, Qt::WindowFlags wFlag
s = 0) : QGraphicsProxyWidget(parent, wFlags)
{
setFocusPolicy(Qt::StrongFocus);
}
//! Reimplement this method to add windows decorations. Curr
ently there are invisible 2 px decorations
void paintWindowFrame(QPainter*, const QStyleOptionGraphicsI
tem*, QWidget*)
{
/* QStyleOptionTitleBar bar;
initStyleOption(&bar);
bar.subControls = QStyle::SC_TitleBarCloseButton;
qWarning() << style()->subControlRect(QStyle::CC_Tit
leBar, &bar, QStyle::SC_TitleBarCloseButton);
QGraphicsProxyWidget::paintWindowFrame(painter, opti
on, widget);*/
}
signals: void sizeChanged(QSizeF);
protected:
virtual bool event(QEvent* event)
{
if (StelApp::getInstance().getSettings()->value("gui
/flag_use_window_transparency", true).toBool())
{
switch (event->type())
{
case QEvent::WindowDeactivate:
widget()->setWindowOpacity(0
.4);
break;
case QEvent::WindowActivate:
case QEvent::GrabMouse:
widget()->setWindowOpacity(0
.9);
break;
default:
break;
}
}
return QGraphicsProxyWidget::event(event);
}
virtual void resizeEvent(QGraphicsSceneResizeEvent *event)
{
if (event->newSize() != event->oldSize())
{
emit sizeChanged(event->newSize());
}
QGraphicsProxyWidget::resizeEvent(event);
}
};
#endif // _STELDIALOG_HPP_ #endif // _STELDIALOG_HPP_
 End of changes. 4 change blocks. 
1 lines changed or deleted 65 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/