mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-23 07:01:39 +00:00
@@ -5,11 +5,12 @@ result = Window(610, 400, "Re-Prioritize duplicates")
|
||||
promptLabel = Label(result, "Add criteria to the right box and click OK to send the dupes that "
|
||||
"correspond the best to these criteria to their respective group's reference position. Read "
|
||||
"the help file for more information.")
|
||||
categoryPopup = Popup(result)
|
||||
criteriaTable = ListView(result)
|
||||
prioritizationTable = ListView(result)
|
||||
addButton = Button(result, NLSTR("-->"))
|
||||
removeButton = Button(result, NLSTR("<--"))
|
||||
split = SplitView(result, 2, vertical=True)
|
||||
categoryPopup = Popup(split.subviews[0])
|
||||
criteriaTable = ListView(split.subviews[0])
|
||||
prioritizationTable = ListView(split.subviews[1])
|
||||
addButton = Button(split.subviews[1], NLSTR("-->"))
|
||||
removeButton = Button(split.subviews[1], NLSTR("<--"))
|
||||
okButton = Button(result, "Ok")
|
||||
cancelButton = Button(result, "Cancel")
|
||||
|
||||
@@ -27,24 +28,38 @@ cancelButton.action = Action(owner, 'cancel')
|
||||
okButton.keyEquivalent = '\\r'
|
||||
cancelButton.keyEquivalent = '\\e'
|
||||
|
||||
# For layouts to correctly work, subviews need to have the dimensions they'll approximately have
|
||||
# at runtime.
|
||||
split.subviews[0].width = 260
|
||||
split.subviews[0].height = 260
|
||||
split.subviews[1].width = 340
|
||||
split.subviews[1].height = 260
|
||||
promptLabel.height *= 3 # 3 lines
|
||||
|
||||
leftLayout = VLayout([categoryPopup, criteriaTable], width=262, filler=criteriaTable)
|
||||
leftLayout = VLayout([categoryPopup, criteriaTable], filler=criteriaTable)
|
||||
middleLayout = VLayout([addButton, removeButton], width=41)
|
||||
buttonLayout = HLayout([None, cancelButton, okButton])
|
||||
|
||||
#pack split subview 0
|
||||
leftLayout.fillAll()
|
||||
|
||||
#pack split subview 1
|
||||
prioritizationTable.fillAll()
|
||||
prioritizationTable.width -= 48
|
||||
prioritizationTable.moveTo(Pack.Right)
|
||||
middleLayout.moveNextTo(prioritizationTable, Pack.Left, align=Pack.Middle)
|
||||
|
||||
# Main layout
|
||||
promptLabel.packToCorner(Pack.UpperLeft)
|
||||
promptLabel.fill(Pack.Right)
|
||||
leftLayout.packRelativeTo(promptLabel, Pack.Below)
|
||||
middleLayout.packRelativeTo(leftLayout, Pack.Right, align=Pack.Above)
|
||||
prioritizationTable.packRelativeTo(middleLayout, Pack.Right, align=Pack.Above)
|
||||
buttonLayout.packRelativeTo(leftLayout, Pack.Below)
|
||||
split.moveNextTo(promptLabel, Pack.Below)
|
||||
buttonLayout.moveNextTo(split, Pack.Below)
|
||||
buttonLayout.fill(Pack.Right)
|
||||
leftLayout.fill(Pack.Below)
|
||||
middleLayout.packRelativeTo(leftLayout, Pack.Right, align=Pack.Middle)
|
||||
prioritizationTable.fill(Pack.Below, goal=leftLayout.y)
|
||||
prioritizationTable.fill(Pack.Right)
|
||||
split.fill(Pack.LowerRight)
|
||||
|
||||
promptLabel.setAnchor(Pack.UpperLeft, growX=True)
|
||||
prioritizationTable.setAnchor(Pack.UpperLeft, growX=True, growY=True)
|
||||
categoryPopup.setAnchor(Pack.UpperLeft, growX=True)
|
||||
criteriaTable.setAnchor(Pack.UpperLeft, growX=True, growY=True)
|
||||
split.setAnchor(Pack.UpperLeft, growX=True, growY=True)
|
||||
buttonLayout.setAnchor(Pack.Below)
|
||||
|
||||
Reference in New Issue
Block a user