mirror of
https://github.com/YACReader/yacreader
synced 2025-07-17 20:44:32 -04:00
clang-format
This commit is contained in:
@ -13,7 +13,7 @@
|
||||
#import "shortcuts_manager.h"
|
||||
|
||||
//----------------------------
|
||||
//A custom items separator for NSToolbar
|
||||
// A custom items separator for NSToolbar
|
||||
@interface CustomSeparator : NSView
|
||||
|
||||
@end
|
||||
@ -30,7 +30,7 @@
|
||||
@end
|
||||
|
||||
//----------------------------
|
||||
//Toolbar delegate, needed for allow disabled/enabled items
|
||||
// Toolbar delegate, needed for allow disabled/enabled items
|
||||
@interface MyToolbarDelegate : NSObject <NSToolbarDelegate> {
|
||||
@public
|
||||
YACReaderMacOSXToolbar *mytoolbar;
|
||||
@ -131,8 +131,8 @@
|
||||
@end
|
||||
|
||||
//----------------------------
|
||||
//detect changes in native text field
|
||||
//TODO implement validation and auto completion
|
||||
// detect changes in native text field
|
||||
// TODO implement validation and auto completion
|
||||
@interface MyTextFieldDelegate : NSObject <NSTextFieldDelegate> {
|
||||
@public
|
||||
YACReaderMacOSXSearchLineEdit *mylineedit;
|
||||
@ -154,7 +154,7 @@
|
||||
YACReaderMacOSXToolbar::YACReaderMacOSXToolbar(QObject *parent)
|
||||
: viewSelector(0)
|
||||
{
|
||||
//setup native toolbar
|
||||
// setup native toolbar
|
||||
nativeToolBar = nativeToolbar();
|
||||
[nativeToolBar setDisplayMode:NSToolbarDisplayModeIconOnly];
|
||||
[nativeToolBar setAllowsUserCustomization:NO];
|
||||
@ -167,18 +167,18 @@ YACReaderMacOSXToolbar::YACReaderMacOSXToolbar(QObject *parent)
|
||||
NSWindow *nswindow = (NSWindow *)qApp->platformNativeInterface()->nativeResourceForWindow("nswindow", ((QMainWindow *)parent)->windowHandle());
|
||||
if ([nswindow respondsToSelector:@selector(setTitleVisibility:)]) {
|
||||
yosemite = true;
|
||||
//TODO yosemite new constants are not found in compilation time
|
||||
// TODO yosemite new constants are not found in compilation time
|
||||
[nswindow setTitleVisibility:NSWindowTitleHidden];
|
||||
//TODO NSFullSizeContentViewWindowMask produces an offset in the windows' content
|
||||
//nswindow.styleMask |= 1 << 15; // NSFullSizeContentViewWindowMask;
|
||||
[nativeToolBar setSizeMode:NSToolbarSizeModeSmall]; //TODO figure out how to load specific images in Yosemite
|
||||
// TODO NSFullSizeContentViewWindowMask produces an offset in the windows' content
|
||||
// nswindow.styleMask |= 1 << 15; // NSFullSizeContentViewWindowMask;
|
||||
[nativeToolBar setSizeMode:NSToolbarSizeModeSmall]; // TODO figure out how to load specific images in Yosemite
|
||||
} else {
|
||||
[nativeToolBar setSizeMode:NSToolbarSizeModeSmall];
|
||||
yosemite = false;
|
||||
}
|
||||
#else
|
||||
yosemite = false;
|
||||
[nativeToolBar setAutosavesConfiguration:YES]; //TODO this doesn't work
|
||||
[nativeToolBar setAutosavesConfiguration:YES]; // TODO this doesn't work
|
||||
[nativeToolBar setSizeMode:NSToolbarSizeModeSmall];
|
||||
#endif
|
||||
}
|
||||
@ -194,12 +194,12 @@ void YACReaderMacOSXToolbar::addAction(QAction *action)
|
||||
actions.insert(QString::fromNSString(nativeItem.itemIdentifier), action);
|
||||
|
||||
MacToolBarItemWrapper *wrapper = new MacToolBarItemWrapper(action, toolBarItem);
|
||||
//wrapper->actionToogled(true);
|
||||
// wrapper->actionToogled(true);
|
||||
}
|
||||
|
||||
void YACReaderMacOSXToolbar::addDropDownItem(const QList<QAction *> &actions, const QAction *defaultAction)
|
||||
{
|
||||
//TODO
|
||||
// TODO
|
||||
}
|
||||
|
||||
void YACReaderMacOSXToolbar::addSpace(int size)
|
||||
@ -213,10 +213,10 @@ void YACReaderMacOSXToolbar::addSpace(int size)
|
||||
[nativeItem setView:view];
|
||||
}
|
||||
|
||||
//reimplemented for convenience
|
||||
// reimplemented for convenience
|
||||
void YACReaderMacOSXToolbar::addSeparator()
|
||||
{
|
||||
//QMacToolBar::addSeparator();
|
||||
// QMacToolBar::addSeparator();
|
||||
|
||||
QMacToolBarItem *toolBarItem = addItem(QIcon(), "");
|
||||
NSToolbarItem *nativeItem = toolBarItem->nativeToolBarItem();
|
||||
@ -235,7 +235,7 @@ void YACReaderMacOSXToolbar::addStretch()
|
||||
|
||||
void YACReaderMacOSXToolbar::addWidget(QWidget *widget)
|
||||
{
|
||||
//TODO fix it
|
||||
// TODO fix it
|
||||
/* QMacNativeWidget *nativeWidget = new QMacNativeWidget();
|
||||
QVBoxLayout *layout = new QVBoxLayout();
|
||||
layout->addWidget(widget);
|
||||
@ -277,7 +277,7 @@ YACReaderMacOSXSearchLineEdit *YACReaderMacOSXToolbar::addSearchEdit()
|
||||
return searchEdit;
|
||||
}
|
||||
|
||||
//deprecated
|
||||
// deprecated
|
||||
QAction *YACReaderMacOSXToolbar::addFitToWidthSlider(QAction *attachToAction)
|
||||
{
|
||||
QMacToolBarItem *toolBarItem = addItem(QIcon(":/images/viewer_toolbar/toWidthSlider.png"), "fit to width slider");
|
||||
@ -302,7 +302,7 @@ YACReaderMacOSXSearchLineEdit::YACReaderMacOSXSearchLineEdit()
|
||||
: QObject()
|
||||
{
|
||||
NSRect searchEditFrameRect = { { 0.0, -3.0 }, { 165, 32.0 } };
|
||||
//NSTextField * searchEdit = [[NSTextField alloc] initWithFrame:searchEditFrameRect];
|
||||
// NSTextField * searchEdit = [[NSTextField alloc] initWithFrame:searchEditFrameRect];
|
||||
|
||||
NSTextField *searchEdit = [[NSSearchField alloc] initWithFrame:searchEditFrameRect];
|
||||
//[searchEdit setBezelStyle:NSTextFieldRoundedBezel];
|
||||
@ -341,7 +341,7 @@ void YACReaderMacOSXSearchLineEdit::clear()
|
||||
|
||||
void YACReaderMacOSXSearchLineEdit::clearText()
|
||||
{
|
||||
//TODO be sure that this will not generate any event....
|
||||
// TODO be sure that this will not generate any event....
|
||||
[((NSTextField *)nstextfield) setStringValue:@""];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user