bugfixes and nicer filter tab

This commit is contained in:
Manuel Simon Hirsig
2016-08-02 05:44:51 +02:00
parent c528353bf0
commit 3de05978c6
6 changed files with 27 additions and 25 deletions
+8 -8
View File
@@ -6,7 +6,7 @@ public.config = {
window_color = { backdrop = {24/255, 24/255, 24/255, .93}, border = {30/255, 30/255, 30/255, 1} },
panel_color = { backdrop = {24/255, 24/255, 24/255, 1}, border = {1, 1, 1, .03} },
content_color = { backdrop = {42/255, 42/255, 42/255, 1}, border = {0, 0, 0, 0} },
content_font = [[Fonts\ARIALN.TTF]],
font = [[Fonts\ARIALN.TTF]],
normal_font_size = 15,
text_color = { enabled = { 255/255, 254/255, 250/255, 1 }, disabled = { 147/255, 151/255, 139/255, 1 } },
label_color = { enabled = { 216/255, 225/255, 211/255, 1 }, disabled = { 150/255, 148/255, 140/255, 1 } },
@@ -72,7 +72,7 @@ function public.button(parent, text_height)
button.highlight = highlight
do
local label = button:CreateFontString()
label:SetFont(m.config.content_font, text_height)
label:SetFont(m.config.font, text_height)
label:SetPoint('CENTER', 0, 0)
label:SetJustifyH('CENTER')
label:SetJustifyV('CENTER')
@@ -150,7 +150,7 @@ do
tab.text:SetPoint('RIGHT', -3, -1)
tab.text:SetJustifyH('CENTER')
tab.text:SetJustifyV('CENTER')
tab.text:SetFont(m.config.content_font, 18)
tab.text:SetFont(m.config.font, 18)
tab:SetFontString(tab.text)
tab:SetText(text)
@@ -217,7 +217,7 @@ function public.editbox(parent)
editbox:SetTextInsets(0, 0, 3, 3)
editbox:SetMaxLetters(256)
editbox:SetHeight(19)
editbox:SetFont(m.config.content_font, m.config.normal_font_size)
editbox:SetFont(m.config.font, m.config.normal_font_size)
editbox:SetShadowColor(0, 0, 0, 0)
m.set_content_style(editbox)
@@ -339,7 +339,7 @@ end
function public.label(parent, size)
local label = parent:CreateFontString()
label:SetFont(m.config.content_font, size or m.config.normal_font_size)
label:SetFont(m.config.font, size or m.config.normal_font_size)
label:SetTextColor(unpack(m.config.label_color.enabled))
return label
end
@@ -389,7 +389,7 @@ function public.dropdown(parent)
text:ClearAllPoints()
text:SetPoint('RIGHT', button, 'LEFT', -2, 0)
text:SetPoint('LEFT', dropdown, 'LEFT', 8, 0)
text:SetFont(m.config.content_font, 13)
text:SetFont(m.config.font, 13)
text:SetShadowColor(0, 0, 0, 0)
--
@@ -439,7 +439,7 @@ function public.slider(frame)
label:SetPoint('BOTTOMRIGHT', slider, 'TOPRIGHT', 6, 6)
label:SetJustifyH('LEFT')
label:SetHeight(13)
label:SetFont(m.config.content_font, 13)
label:SetFont(m.config.font, 13)
label:SetTextColor(unpack(m.config.label_color.enabled))
local editbox = m.editbox(slider)
@@ -485,7 +485,7 @@ end
-- text:SetHeight(18)
-- text:SetPoint('LEFT', checkbox, 'RIGHT')
-- text:SetPoint('RIGHT')
-- text:SetFont(m.config.content_font, m.config.normal_font_size)
-- text:SetFont(m.config.font, m.config.normal_font_size)
--
-- checkbox.text = text
-- return checkbox
+2 -2
View File
@@ -1073,7 +1073,7 @@ function public.CreateAuctionResultsTable(parent, config)
local text = cell:CreateFontString()
text:SetJustifyH('CENTER')
text:SetJustifyV('CENTER')
text:SetFont(Aux.gui.config.content_font, 12)
text:SetFont(Aux.gui.config.font, 12)
text:SetTextColor(unpack(Aux.gui.config.label_color.enabled))
cell:SetFontString(text)
if not column_config.isPrice then cell:SetText(column_config.title or '') end -- TODO
@@ -1119,7 +1119,7 @@ function public.CreateAuctionResultsTable(parent, config)
for j=1, getn(rt.config) do
local cell = CreateFrame('Button', nil, row)
local text = cell:CreateFontString()
text:SetFont(Aux.gui.config.content_font, min(14, rt.ROW_HEIGHT))
text:SetFont(Aux.gui.config.font, min(14, rt.ROW_HEIGHT))
text:SetJustifyH(rt.config[j].align or 'LEFT')
text:SetJustifyV('CENTER')
text:SetPoint('TOPLEFT', 1, -1)
+4 -4
View File
@@ -308,7 +308,7 @@ local methods = {
local text = col:CreateFontString()
text:SetJustifyV('CENTER')
text:SetFont(Aux.gui.config.content_font, 15)
text:SetFont(Aux.gui.config.font, 15)
text:SetTextColor(unpack(Aux.gui.config.text_color.enabled))
col.text = text
col:SetFontString(text)
@@ -336,7 +336,7 @@ local methods = {
local colNum = getn(row.cols) + 1
local col = CreateFrame('Button', nil, row)
local text = col:CreateFontString()
text:SetFont(Aux.gui.config.content_font, ST_ROW_TEXT_SIZE)
text:SetFont(Aux.gui.config.font, ST_ROW_TEXT_SIZE)
text:SetJustifyV('CENTER')
text:SetPoint('TOPLEFT', 1, -1)
text:SetPoint('BOTTOMRIGHT', -1, 1)
@@ -392,9 +392,9 @@ local methods = {
-- update the text size of the head cols
for _, col in ipairs(st.headCols) do
if st.sizes.headFontSize then
col.text:SetFont(Aux.gui.config.content_font, st.sizes.headFontSize)
col.text:SetFont(Aux.gui.config.font, st.sizes.headFontSize)
else
col.text:SetFont(Aux.gui.config.content_font, 15)
col.text:SetFont(Aux.gui.config.font, 15)
end
end
st:Redraw()
+1 -1
View File
@@ -862,7 +862,7 @@ function private.add_post_filter()
if name then
local filter = name
if not Aux.filter.filters[name] and filter == 'and' or filter == 'or' then
if not tonumber(m.filter_input:GetText()) and m.filter_input:GetText() ~= '*' then
if m.filter_input:GetText() ~= '' and m.filter_input:GetText() ~= '*' and (tonumber(m.filter_input:GetText() or 3 <= 2)) then
Aux.log('Invalid operator suffix')
return
end
+8 -5
View File
@@ -551,11 +551,14 @@ Aux.search_tab.FRAMES(function(m, public, private)
private.filter_input = input
end
do
local label = Aux.gui.label(m.frame.filter, 13)
label:SetPoint('TOPLEFT', 350, -40)
label:SetWidth(300)
label:SetJustifyH('LEFT')
private.filter_display = label
local display = CreateFrame('SimpleHTML', nil, m.frame.filter)
display:SetPoint('TOPLEFT', 348, -50)
display:SetWidth(395)
display:SetHeight(270)
display:SetFont('p', Aux.gui.config.font, 13)
display:SetJustifyH('LEFT')
Aux.gui.set_content_style(display)
private.filter_display = display
end
private.status_bars = {}
+4 -5
View File
@@ -541,12 +541,11 @@ function public.indented_post_query_string(components)
local stack = {}
local str = ''
for _, component in components do
for i, component in components do
if no_line_break then
str = str..' '
else
str = str..'|n'
elseif i > 1 then
str = str..'</p><p>'
for _=1,getn(stack) do
str = str..' '
end
@@ -576,7 +575,7 @@ function public.indented_post_query_string(components)
end
end
return str
return '<html><body><p>'..str..'</p></body></html>'
end
function private.prettified_query_string(components)