mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 22:51:39 +00:00
xibless-ified DirectoryPanel.
--HG-- branch : xibless
This commit is contained in:
@@ -27,8 +27,6 @@ col.autoResizable = True
|
||||
col = table.addColumn('2', "Reference", 172)
|
||||
col.autoResizable = True
|
||||
|
||||
result.ignoreMargin = True
|
||||
table.packToCorner(Pack.UpperLeft)
|
||||
table.fill(Pack.Right)
|
||||
table.fill(Pack.Below)
|
||||
table.packToCorner(Pack.UpperLeft, margin=0)
|
||||
table.fill(Pack.LowerRight, margin=0)
|
||||
table.setAnchor(Pack.UpperLeft, growX=True, growY=True)
|
||||
|
||||
59
cocoa/base/ui/directory_panel.py
Normal file
59
cocoa/base/ui/directory_panel.py
Normal file
@@ -0,0 +1,59 @@
|
||||
ownerclass = 'DirectoryPanel'
|
||||
ownerimport = 'DirectoryPanel.h'
|
||||
|
||||
result = Window(425, 300, "dupeGuru")
|
||||
promptLabel = Label(result, "Select folders to scan and press \"Scan\".")
|
||||
directoryOutline = OutlineView(result)
|
||||
directoryOutline.OBJC_CLASS = 'HSOutlineView'
|
||||
addButton = Button(result, "")
|
||||
removeButton = Button(result, "")
|
||||
loadResultsButton = Button(result, "Load Results")
|
||||
scanButton = Button(result, "Scan")
|
||||
addPopup = Popup(None)
|
||||
loadRecentPopup = Popup(None)
|
||||
|
||||
owner.outlineView = directoryOutline
|
||||
owner.removeButton = removeButton
|
||||
owner.loadResultsButton = loadResultsButton
|
||||
owner.addButtonPopUp = addPopup
|
||||
owner.loadRecentButtonPopUp = loadRecentPopup
|
||||
|
||||
result.autosaveName = 'DirectoryPanel'
|
||||
result.canMinimize = False
|
||||
result.minSize = Size(370, 270)
|
||||
addButton.image = 'NSAddTemplate'
|
||||
removeButton.image = 'NSRemoveTemplate'
|
||||
for button in (addButton, removeButton):
|
||||
button.style = const.NSTexturedRoundedBezelStyle
|
||||
button.imagePosition = const.NSImageOnly
|
||||
scanButton.keyEquivalent = '\\r'
|
||||
addButton.action = Action(owner, 'popupAddDirectoryMenu:')
|
||||
removeButton.action = Action(owner, 'removeSelectedDirectory')
|
||||
loadResultsButton.action = Action(owner, 'popupLoadRecentMenu:')
|
||||
scanButton.action = Action(None, 'startScanning:')
|
||||
|
||||
directoryOutline.font = Font(FontFamily.System, FontSize.SmallSystem)
|
||||
col = directoryOutline.addColumn('name', "Name", 100)
|
||||
col.editable = False
|
||||
col.autoResizable = True
|
||||
col = directoryOutline.addColumn('state', "State", 85)
|
||||
col.editable = True
|
||||
col.autoResizable = False
|
||||
col.dataCell = Popup(None, ["Normal", "Reference", "Excluded"])
|
||||
col.dataCell.controlSize = const.NSSmallControlSize
|
||||
|
||||
for button in (addButton, removeButton):
|
||||
button.width = 28
|
||||
for button in (loadResultsButton, scanButton):
|
||||
button.width = 118
|
||||
|
||||
buttonLayout = HLayout(left=[addButton, removeButton], right=[loadResultsButton, scanButton])
|
||||
promptLabel.packToCorner(Pack.UpperLeft)
|
||||
promptLabel.fill(Pack.Right)
|
||||
directoryOutline.packRelativeTo(promptLabel, Pack.Below)
|
||||
buttonLayout.packRelativeTo(directoryOutline, Pack.Below, margin=8)
|
||||
directoryOutline.fill(Pack.LowerRight)
|
||||
|
||||
promptLabel.setAnchor(Pack.UpperLeft, growX=True)
|
||||
directoryOutline.setAnchor(Pack.UpperLeft, growX=True, growY=True)
|
||||
buttonLayout.setAnchor(Pack.Below)
|
||||
Reference in New Issue
Block a user