From bf0ec1b8593f32011971bec6241e877955b8c799 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Fri, 4 Oct 2024 14:16:36 -0700 Subject: [PATCH] redo layout of conflict report dialog --- uniform-unstick.lua | 49 ++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/uniform-unstick.lua b/uniform-unstick.lua index af86aa800..b40484332 100644 --- a/uniform-unstick.lua +++ b/uniform-unstick.lua @@ -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