* When toolbars are hidden, they pop up again after clicking on the document
area (Joost 4/11/06).
-* Icons in the toolbars do not have the correct size, they are stretched a few
- pixels compared to 1.4. This makes the images look jagged and the initial
- window size has also become to small to show the whole toolbar
- (Joost 4/11/06). See also the math panel buttons entry above.
-
* TODO toolbar popup menu, currently disabled (Peter 9/11/06)
* new document; insert note; insert "hello" into note; place the cursor at the beginning of the note;
activate change tracking; press backspace => seg fault
FIXED (Michael 2006-11-25)
+
+* Icons in the toolbars do not have the correct size, they are stretched a few
+ pixels compared to 1.4. This makes the images look jagged and the initial
+ window size has also become to small to show the whole toolbar
+ (Joost 4/11/06). See also the math panel buttons entry above.
+ FIXED (Peter, 2006-11-28)
+
LyXView & Application::createView(unsigned int width,
unsigned int height,
int posx, int posy,
- bool maximize)
+ bool maximize,
+ unsigned int iconSizeXY)
{
int view_id = gui().newView();
LyXView & view = gui().view(view_id);
/*int workArea_id_ =*/ gui().newWorkArea(width, height, view_id);
view.init();
- view.setGeometry(width, height, posx, posy, maximize);
+ view.setGeometry(width, height, posx, posy, maximize, iconSizeXY);
setCurrentView(view);
/// Create the main window with given geometry settings.
LyXView & createView(unsigned int width, unsigned int height,
- int posx, int posy, bool maximize);
+ int posx, int posy, bool maximize, unsigned int iconSizeXY);
///
LyXView const & currentView() const;
unsigned int width,
unsigned int height,
int posx, int posy,
- bool maximize) = 0;
+ bool maximize,
+ unsigned int iconSizeXY) = 0;
/// save the geometry state in the session manager.
virtual void saveGeometry() = 0;
* \author Lars Gullik Bjønnes
* \author John Levon
* \author Abdelrazak Younes
+ * \author Peter Kümmel
*
* Full author contact details are available in file CREDITS.
*/
GuiViewPrivate() : wt(0), posx_offset(0), posy_offset(0)
{}
+
+ static int iconSizeXY_;
};
+int GuiView::GuiViewPrivate::iconSizeXY_ = -1;
+
GuiView::GuiView(int id)
: QMainWindow(), LyXView(id), commandbuffer_(0), d(*new GuiViewPrivate)
{
-// setToolButtonStyle(Qt::ToolButtonIconOnly);
-// setIconSize(QSize(12,12));
+ // static var needed by the "New Window", because setGeometry will not be called
+ if (GuiViewPrivate::iconSizeXY_ != -1)
+ setIconSize(QSize(GuiViewPrivate::iconSizeXY_, GuiViewPrivate::iconSizeXY_));
-// bufferview_.reset(new BufferView(this, width, height));
+ //bufferview_.reset(new BufferView(this, width, height));
#ifndef Q_WS_MACX
// assign an icon to main form. We do not do it under Qt/Mac,
QMenu* GuiView::createPopupMenu()
{
// disable toolbar popup menu
- // Qt docs: Ownership of the popup menu is transferred to the caller.
- return new QMenu;
+ return 0;
}
void GuiView::init()
session.sessionInfo().save("WindowWidth", convert<string>(geometry.width()));
session.sessionInfo().save("WindowHeight", convert<string>(geometry.height()));
session.sessionInfo().save("WindowIsMaximized", (isMaximized() ? "yes" : "no"));
+ session.sessionInfo().save("IconSizeXY", convert<string>(iconSize().width()));
if (lyxrc.geometry_xysaved) {
session.sessionInfo().save("WindowPosX", convert<string>(geometry.x() + d.posx_offset));
session.sessionInfo().save("WindowPosY", convert<string>(geometry.y() + d.posy_offset));
void GuiView::setGeometry(unsigned int width,
unsigned int height,
int posx, int posy,
- bool maximize)
+ bool maximize,
+ unsigned int iconSizeXY)
{
+ if (iconSizeXY > 8)
+ GuiViewPrivate::iconSizeXY_ = iconSizeXY;
+ else
+ GuiViewPrivate::iconSizeXY_ = 28;
+ setIconSize(QSize(GuiViewPrivate::iconSizeXY_, GuiViewPrivate::iconSizeXY_));
+
// only true when the -geometry option was NOT used
if (width != 0 && height != 0) {
if (posx != -1 && posy != -1) {
unsigned int width,
unsigned int height,
int posx, int posy,
- bool maximize);
+ bool maximize,
+ unsigned int iconSizeXY);
virtual void saveGeometry();
virtual void busy(bool);
Toolbars::ToolbarPtr makeToolbar(ToolbarBackend::Toolbar const & tbb);
// initial geometry
unsigned int width = 690;
unsigned int height = 510;
+ // default icon size, will be overwritten by stored session value
+ unsigned int iconSizeXY = 26;
bool maximize = false;
// first try lyxrc
if (lyxrc.geometry_width != 0 && lyxrc.geometry_height != 0 ) {
height = convert<unsigned int>(val);
if (session().sessionInfo().load("WindowIsMaximized") == "yes")
maximize = true;
+ val = session().sessionInfo().load("IconSizeXY");
+ if (!val.empty())
+ iconSizeXY = convert<unsigned int>(val);
}
// if user wants to restore window position
height = 0;
}
// create the main window
- LyXView * view = &pimpl_->application_->createView(width, height, posx, posy, maximize);
+ LyXView * view = &pimpl_->application_->createView(width, height, posx, posy, maximize, iconSizeXY);
return view;
}