mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
fixed addSpace
This commit is contained in:
parent
33e022de5e
commit
0f5e97af64
@ -173,8 +173,9 @@ YACReaderMacOSXToolbar::YACReaderMacOSXToolbar(QObject *parent)
|
|||||||
[nswindow setTitleVisibility:1];
|
[nswindow setTitleVisibility:1];
|
||||||
}else
|
}else
|
||||||
yosemite = false;
|
yosemite = false;
|
||||||
#endif
|
#else
|
||||||
yosemite = false;
|
yosemite = false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void YACReaderMacOSXToolbar::addAction(QAction *action)
|
void YACReaderMacOSXToolbar::addAction(QAction *action)
|
||||||
@ -195,16 +196,12 @@ void YACReaderMacOSXToolbar::addDropDownItem(const QList<QAction *> &actions, co
|
|||||||
void YACReaderMacOSXToolbar::addSpace(int size)
|
void YACReaderMacOSXToolbar::addSpace(int size)
|
||||||
{
|
{
|
||||||
QMacToolBarItem *toolBarItem = addItem(QIcon(),"");
|
QMacToolBarItem *toolBarItem = addItem(QIcon(),"");
|
||||||
//NSToolbarItem * nativeItem = toolBarItem->nativeToolBarItem();
|
|
||||||
toolBarItem->setStandardItem(QMacToolBarItem::Space);
|
|
||||||
|
|
||||||
NSToolbarItem * nativeItem = toolBarItem->nativeToolBarItem();
|
NSToolbarItem * nativeItem = toolBarItem->nativeToolBarItem();
|
||||||
|
|
||||||
//TODO this doesn't work
|
static const NSRect frameRect = { { 0.0, 0.0 }, { size, 16.0 } };
|
||||||
[nativeItem setMaxSize:NSMakeSize(size,24)];
|
NSView *view = [[NSView alloc] initWithFrame:frameRect];
|
||||||
[nativeItem setMinSize:NSMakeSize(size,24)];
|
|
||||||
|
|
||||||
//if a fix isn't found probably it is better to use QMacToolBar::
|
[nativeItem setView:view];
|
||||||
}
|
}
|
||||||
|
|
||||||
//reimplemented for convenience
|
//reimplemented for convenience
|
||||||
@ -215,8 +212,8 @@ void YACReaderMacOSXToolbar::addSeparator()
|
|||||||
QMacToolBarItem *toolBarItem = addItem(QIcon(),"");
|
QMacToolBarItem *toolBarItem = addItem(QIcon(),"");
|
||||||
NSToolbarItem * nativeItem = toolBarItem->nativeToolBarItem();
|
NSToolbarItem * nativeItem = toolBarItem->nativeToolBarItem();
|
||||||
|
|
||||||
static const NSRect buttonFrameRect = { { 0.0, 0.0 }, { 1, 16.0 } };
|
static const NSRect frameRect = { { 0.0, 0.0 }, { 1, 16.0 } };
|
||||||
CustomSeparator *view = [[CustomSeparator alloc] initWithFrame:buttonFrameRect];
|
CustomSeparator *view = [[CustomSeparator alloc] initWithFrame:frameRect];
|
||||||
|
|
||||||
[nativeItem setView:view];
|
[nativeItem setView:view];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user