[Kst] branches/work/kst/kst1kde4/kst/src/libkstapp
Zongyi Zhang
freebody.kst at gmail.com
Sat Apr 24 01:19:38 CEST 2010
SVN commit 1118115 by zhang:
continue kst1kde4
M +9 -14 kst.cpp
M +3 -0 kst.h
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kst.cpp #1118114:1118115
@@ -128,6 +128,9 @@
_menuBar = 0L;
_updateThread = 0L;
+ _layoutToolBarMenu = new QToolButton(this);
+ mouseModeMenu = new QMenu(this);
+
//
// create the mdi area...
//
@@ -340,7 +343,10 @@
_toolBar->addAction(_actionTiedZoom);
_toolBar->addAction(_actionDataMode);
-// xxx _toolBar->addAction(_actionLayout);
+
+ _layoutToolBarMenu->setMenu(mouseModeMenu);
+ _layoutToolBarMenu->setPopupMode(QToolButton::InstantPopup);
+ _toolBar->addWidget(_layoutToolBarMenu);
}
@@ -378,7 +384,7 @@
_actionZoomXY->setIcon(QIcon((":/kst_zoomxy.png")));
_actionTiedZoom->setIcon(QIcon((":/kst_zoomtie.png")));
_actionDataMode->setIcon(QIcon((":/kst_datamode.png")));
-// xxx _actionLayout->setIcon(QIcon((":/kst_layoutmode.png")));
+ _layoutToolBarMenu->setIcon(QIcon((":/kst_zoomxy.png")));
_actionGfxArrow->setIcon(QIcon((":/kst_gfx_arrow.png")));
_actionGfxRectangle->setIcon(QIcon((":/kst_gfx_rectangle.png")));
@@ -620,22 +626,11 @@
*/
// this is the mouse mode menu
- QMenu* mouseModeMenu = new QMenu(this);
-
mouseModeMenu->addAction(_actionZoomXY);
mouseModeMenu->addAction(_actionZoomX);
mouseModeMenu->addAction(_actionZoomY);
mouseModeMenu->addSeparator();
-// xxx mouseModeMenu->addAction(_actionLayout);
- mouseModeMenu->addSeparator();
- mouseModeMenu->addAction(_actionGfxLabel);
- mouseModeMenu->addAction(_actionGfxRectangle);
- mouseModeMenu->addAction(_actionGfxEllipse);
- mouseModeMenu->addAction(_actionGfxLine);
- mouseModeMenu->addAction(_actionGfxArrow);
- mouseModeMenu->addAction(_actionGfxPicture);
- mouseModeMenu->addAction(_actionGfx2DPlot);
- mouseModeMenu->addAction(_actionGfxLegend);
+ mouseModeMenu->addMenu(_menuLayoutMode);
/* xxx
toolBar()->insertButton("thumbnail", MODE_BUTTON_ID, mouseModeMenu, true, QObject::tr("Select the desired mode"));
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kst.h #1118114:1118115
@@ -30,6 +30,7 @@
#include <QSettings>
#include <QTimer>
#include <QToolBar>
+#include <QToolButton>
#include "kst_export.h"
#include "kstpainter.h"
@@ -320,6 +321,8 @@
QToolBar *_toolBar;
QMenuBar *_menuBar;
QMdiArea *_mdiArea;
+ QToolButton *_layoutToolBarMenu;
+ QMenu *mouseModeMenu;
// xxx KstIfaceImpl *_dcopIface;
UpdateThread *_updateThread;
More information about the Kst
mailing list