本文整理汇总了Python中AppKit.NSFont.smallSystemFontSize方法的典型用法代码示例。如果您正苦于以下问题:Python NSFont.smallSystemFontSize方法的具体用法?Python NSFont.smallSystemFontSize怎么用?Python NSFont.smallSystemFontSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppKit.NSFont
的用法示例。
在下文中一共展示了NSFont.smallSystemFontSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initWithDropboxApp_initialIgnoreList_takeAction_callback_remote_
# 需要导入模块: from AppKit import NSFont [as 别名]
# 或者: from AppKit.NSFont import smallSystemFontSize [as 别名]
def initWithDropboxApp_initialIgnoreList_takeAction_callback_remote_(self, dropbox_app, initial_ignore_list, take_action, callback, remote):
self = super(SelectiveSyncView, self).initWithFrame_(NSZeroRect)
if self is None:
return
self._initial_ignore_list = initial_ignore_list
self._callback = callback
self._take_action = take_action
self._remote = remote
self.setAutoresizingMask_(NSViewWidthSizable | NSViewHeightSizable)
self._dropbox_app = dropbox_app
self.initBrowser(self._remote)
self.initButtons()
f = NSFont.systemFontOfSize_(NSFont.smallSystemFontSize())
self.infoLabel = NSTextField.createLabelWithText_font_(selsync_strings.info, f)
self.addSubview_(self.infoLabel)
self.reloadInvalidState()
self.layoutForWidth_(DEFAULT_ADVANCED_WIDTH if self.forest.advanced_view else DEFAULT_SIMPLE_WIDTH)
return self
示例2: layout
# 需要导入模块: from AppKit import NSFont [as 别名]
# 或者: from AppKit.NSFont import smallSystemFontSize [as 别名]
def layout(self):
self._thumbnail = ThumbnailBoxView.alloc().initWithFrame_(NSZeroRect)
self._thumbnail.setImage_(Images.Box64)
self._thumbnail.setImageAlignment_(NSImageAlignCenter)
self._thumbnail.setImageScaling_(NSScaleToFit)
self._thumbnail.setFrameSize_(self.THUMBNAIL_SIZE)
self._thumbnail.setFrameOrigin_(self.THUMBNAIL_ORIGIN)
self._thumbnail.setShadowOffset_(self.SHADOW_OFFSET)
self._thumbnail.setShadowBlurRadius_(self.SHADOW_BLUR)
self._thumbnail.setShadowColor_(NSColor.blackColor().colorWithAlphaComponent_(0.3))
self._label = NSTextField.createLabelWithText_font_('', NSFont.boldSystemFontOfSize_(13))
self._label.setFrameOrigin_(self.LABEL_ORIGIN)
self._progress_bar = NSProgressIndicator.alloc().initWithFrame_(NSRect(self.PROGRESS_ORIGIN, self.PROGRESS_SIZE))
self._progress_bar.setStyle_(NSProgressIndicatorBarStyle)
self._progress_bar.setIndeterminate_(YES)
self._progress_bar.setFrameOrigin_(self.PROGRESS_ORIGIN)
self._estimate = NSTextField.createLabelWithText_font_('', NSFont.systemFontOfSize_(NSFont.smallSystemFontSize()))
self._estimate.setFrameOrigin_(self.ESTIMATE_ORIGIN)
self._hide_button = self.addNormalRoundButtonWithTitle_action_(MiscStrings.hide_button, self.handleHideButton_)
self._hide_button.setKeyEquivalent_(ENTER_KEY)
self._hide_button.alignRightInSuperview()
self._hide_button.alignBottomInSuperview()
self._cancel_button = self.addNormalRoundButtonWithTitle_action_(MiscStrings.cancel_button, self.handleCancelButton_)
self._cancel_button.placeLeftOfButton_(self._hide_button)
self.addSubview_(self._thumbnail)
self.addSubview_(self._label)
self.addSubview_(self._progress_bar)
self.addSubview_(self._estimate)
@message_sender(AppHelper.callAfter)
def handleMessage(message):
self._label.setStringValue_(message)
self._label.sizeToFit()
@message_sender(AppHelper.callAfter)
def handleTotalBytes(total_bytes):
self._progress_bar.setIndeterminate_(YES if total_bytes == 0 else NO)
self._progress_bar.setMinValue_(0.0)
self._progress_bar.setMaxValue_(total_bytes)
self._progress_bar.setDoubleValue_(self.ui.cur_bytes.get())
@message_sender(AppHelper.callAfter)
def handleCurBytes(cur_bytes):
self._progress_bar.setDoubleValue_(cur_bytes)
self._estimate.setStringValue_(self.ui.get_remaining_message())
self._estimate.sizeToFit()
@message_sender(AppHelper.callAfter)
def handleLastPhoto(path):
if path:
if time.time() - self.last_photo_time > self.THUMBNAIL_TIMEOUT:
image = NSImage.alloc().initByReferencingFile_(unicode(path))
if image.isValid():
self._thumbnail.setBorder_(True)
self._thumbnail.setImage_(image)
self.last_photo_time = time.time()
else:
self._thumbnail.setBorder_(False)
self._thumbnail.setImage_(Images.Box64)
handleMessage(self.ui.message.get())
handleTotalBytes(self.ui.total_bytes.get())
handleCurBytes(self.ui.cur_bytes.get())
handleLastPhoto(self.ui.last_photo.get())
self.ui.message.register(handleMessage)
self.ui.total_bytes.register(handleTotalBytes)
self.ui.cur_bytes.register(handleCurBytes)
self.ui.last_photo.register(handleLastPhoto)