Skip to content

Commit

Permalink
redo layout of conflict report dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Oct 4, 2024
1 parent dd9592c commit bf0ec1b
Showing 1 changed file with 31 additions and 18 deletions.
49 changes: 31 additions & 18 deletions uniform-unstick.lua
Original file line number Diff line number Diff line change
Expand Up @@ -283,34 +283,47 @@ end
ReportWindow = defclass(ReportWindow, widgets.Window)
ReportWindow.ATTRS {
frame_title='Equipment conflict report',
frame={w=100, h=45},
resizable=true, -- if resizing makes sense for your dialog
resize_min={w=50, h=20}, -- try to allow users to shrink your windows
autoarrange_subviews=1,
autoarrange_gap=1,
frame={w=100, h=35},
resizable=true,
resize_min={w=60, h=20},
report=DEFAULT_NIL,
}

function ReportWindow:init()
self:addviews{
widgets.HotkeyLabel{
frame={t=0, l=0, r=0},
label='Try to resolve conflicts',
key='CUSTOM_CTRL_T',
auto_width=true,
on_activate=function()
dfhack.run_script('uniform-unstick', '--all', '--drop', '--free')
self.parent_view:dismiss()
end,
widgets.Label{
frame={t=0, l=0},
text_pen=COLOR_YELLOW,
text='Equipment conflict report:',
},
widgets.Panel{
frame={t=2, b=7},
subviews={
widgets.WrappedLabel{
frame={t=0},
text_to_wrap=self.report,
},
},
},
widgets.WrappedLabel{
frame={t=2, l=0, r=0},
frame={b=4, h=2, l=0},
text_pen=COLOR_LIGHTRED,
text_to_wrap='After resolving conflicts, be sure to click the "Update equipment" button to reassign new equipment!',
auto_height=false,
},
widgets.WrappedLabel{
frame={t=4, l=0, r=0},
text_to_wrap=self.report,
widgets.Panel{
frame={b=0, w=34, h=3},
frame_style=gui.FRAME_THIN,
subviews={
widgets.HotkeyLabel{
label='Try to resolve conflicts',
key='CUSTOM_CTRL_T',
on_activate=function()
dfhack.run_script('uniform-unstick', '--all', '--drop', '--free')
self.parent_view:dismiss()
end,
},
},
},
}
end
Expand Down

0 comments on commit bf0ec1b

Please sign in to comment.