From d1cd3bbd53d83b37e9201e97e9e280b134e79d09 Mon Sep 17 00:00:00 2001
From: Manuel Simon Hirsig
Date: Tue, 16 Aug 2016 00:30:29 +0200
Subject: [PATCH] big filter style change
---
gui.lua | 37 ++++++++++++++++++++-----------------
tables/auction_listing.lua | 2 +-
tables/item_listing.lua | 2 +-
tables/listing.lua | 2 +-
tabs/search/filter.lua | 16 ++++++++--------
tabs/search/frames.lua | 5 +++--
util/filter.lua | 16 ++++++++--------
7 files changed, 42 insertions(+), 38 deletions(-)
diff --git a/gui.lua b/gui.lua
index a0a3336..c183d6c 100644
--- a/gui.lua
+++ b/gui.lua
@@ -5,9 +5,9 @@ public.config = {
text = {enabled = {255, 254, 250, 1}, disabled = {147, 151, 139, 1}},
label = {enabled = {216, 225, 211, 1}, disabled = {150, 148, 140, 1}},
link = {153, 255, 255, 1},
- window = {backdrop = {24, 24, 24, .93}, border = {30, 30, 30, 1}},
- panel = {backdrop = {24, 24, 24, 1}, border = {255, 255, 255, .03}},
- content = {backdrop = {42, 42, 42, 1}, border = {0, 0, 0, 0}},
+ window = {background = {24, 24, 24, .93}, border = {30, 30, 30, 1}},
+ panel = {background = {24, 24, 24, 1}, border = {255, 255, 255, .03}},
+ content = {background = {42, 42, 42, 1}, border = {0, 0, 0, 0}},
state = {enabled = {70, 180, 70, 1}, disabled = {190, 70, 70, 1}},
blue = {41, 146, 255, 1},
@@ -16,6 +16,9 @@ public.config = {
orange = {255, 146, 24, 1},
red = {255, 0, 0, 1},
gray = {187, 187, 187, 1},
+
+ blizzard = {0, 180, 255, 1},
+ aux = {255, 255, 154, 1},
},
edge_size = 1.5,
font = [[Fonts\ARIALN.TTF]],
@@ -46,7 +49,7 @@ do
__call = function(self, text)
local r, g, b, a = unpack(self)
if text then
- return format('|c%02X%02X%02X%02X', a*255, r*255, g*255, b)..text..FONT_COLOR_CODE_CLOSE
+ return format('|c%02X%02X%02X%02X', a, r*255, g*255, b*255)..text..FONT_COLOR_CODE_CLOSE
else
return r, g, b, a
end
@@ -112,7 +115,7 @@ do
aux_border:SetPoint('BOTTOMRIGHT', DropDownList1Backdrop, 'BOTTOMRIGHT', 1.5, -1.5)
aux_border:SetBlendMode('ADD')
aux_background = DropDownList1:CreateTexture(nil, 'OVERLAY')
- aux_background:SetTexture(unpack(m.color.content.backdrop))
+ aux_background:SetTexture(unpack(m.color.content.background))
aux_background:SetAllPoints(DropDownList1Backdrop)
blizzard_backdrop = DropDownList1Backdrop:GetBackdrop()
aux.hook('ToggleDropDownMenu', function(...)
@@ -128,7 +131,7 @@ do
end
function private.set_aux_dropdown_style(dropdown)
- DropDownList1Backdrop:SetBackdrop({})
+ DropDownList1Backdrop:SetBackdrop{}
aux_border:Show()
aux_background:Show()
DropDownList1:SetWidth(dropdown:GetWidth() * 0.9)
@@ -188,15 +191,15 @@ function public.set_frame_style(frame, backdrop_color, border_color, left, right
end
function public.set_window_style(frame, left, right, top, bottom)
- m.set_frame_style(frame, m.color.window.backdrop, m.color.window.border, left, right, top, bottom)
+ m.set_frame_style(frame, m.color.window.background, m.color.window.border, left, right, top, bottom)
end
function public.set_panel_style(frame, left, right, top, bottom)
- m.set_frame_style(frame, m.color.panel.backdrop, m.color.panel.border, left, right, top, bottom)
+ m.set_frame_style(frame, m.color.panel.background, m.color.panel.border, left, right, top, bottom)
end
function public.set_content_style(frame, left, right, top, bottom)
- m.set_frame_style(frame, m.color.content.backdrop, m.color.content.border, left, right, top, bottom)
+ m.set_frame_style(frame, m.color.content.background, m.color.content.border, left, right, top, bottom)
end
function public.panel(parent)
@@ -292,7 +295,7 @@ function public.tab_group(parent, orientation)
dock:SetPoint('TOPLEFT', 1, 1)
dock:SetPoint('TOPRIGHT', -1, 1)
end
- dock:SetTexture(unpack(m.color.panel.backdrop))
+ dock:SetTexture(unpack(m.color.panel.background))
tab.dock = dock
local highlight = tab:CreateTexture(nil, 'HIGHLIGHT')
highlight:SetAllPoints()
@@ -347,13 +350,13 @@ function public.tab_group(parent, orientation)
if tab.group.selected == tab.id then
tab.text:SetTextColor(unpack(m.color.label.enabled))
tab:Disable()
- tab:SetBackdropColor(unpack(m.color.panel.backdrop))
+ tab:SetBackdropColor(unpack(m.color.panel.background))
tab.dock:Show()
tab:SetHeight(29)
else
tab.text:SetTextColor(unpack(m.color.text.enabled))
tab:Enable()
- tab:SetBackdropColor(unpack(m.color.content.backdrop))
+ tab:SetBackdropColor(unpack(m.color.content.background))
tab.dock:Hide()
tab:SetHeight(24)
end
@@ -503,9 +506,9 @@ function public.horizontal_line(parent, y_offset, inverted_color)
texture:SetPoint('TOPRIGHT', parent, 'TOPRIGHT', -2, y_offset)
texture:SetHeight(2)
if inverted_color then
- texture:SetTexture(unpack(m.color.panel.backdrop))
+ texture:SetTexture(unpack(m.color.panel.background))
else
- texture:SetTexture(unpack(m.color.content.backdrop))
+ texture:SetTexture(unpack(m.color.content.background))
end
return texture
end
@@ -516,9 +519,9 @@ function public.vertical_line(parent, x_offset, top_offset, bottom_offset, inver
texture:SetPoint('BOTTOMLEFT', parent, 'BOTTOMLEFT', x_offset, bottom_offset or 2)
texture:SetWidth(2)
if inverted_color then
- texture:SetTexture(unpack(m.color.panel.backdrop))
+ texture:SetTexture(unpack(m.color.panel.background))
else
- texture:SetTexture(unpack(m.color.content.backdrop))
+ texture:SetTexture(unpack(m.color.content.background))
end
return texture
end
@@ -558,7 +561,7 @@ function public.slider(parent)
m.set_panel_style(slider)
local thumb_texture = slider:CreateTexture(nil, 'ARTWORK')
thumb_texture:SetPoint('CENTER', 0, 0)
- thumb_texture:SetTexture(unpack(m.color.content.backdrop))
+ thumb_texture:SetTexture(unpack(m.color.content.background))
thumb_texture:SetHeight(18)
thumb_texture:SetWidth(8)
slider:SetThumbTexture(thumb_texture)
diff --git a/tables/auction_listing.lua b/tables/auction_listing.lua
index 4a75cdf..066760e 100644
--- a/tables/auction_listing.lua
+++ b/tables/auction_listing.lua
@@ -1045,7 +1045,7 @@ function public.CreateAuctionResultsTable(parent, config)
scrollBar:SetWidth(10)
local thumbTex = scrollBar:GetThumbTexture()
thumbTex:SetPoint('CENTER', 0, 0)
- thumbTex:SetTexture(unpack(aux.gui.color.content.backdrop))
+ thumbTex:SetTexture(unpack(aux.gui.color.content.background))
thumbTex:SetHeight(150)
thumbTex:SetWidth(scrollBar:GetWidth())
getglobal(scrollBar:GetName()..'ScrollUpButton'):Hide()
diff --git a/tables/item_listing.lua b/tables/item_listing.lua
index 7c4932a..684545e 100644
--- a/tables/item_listing.lua
+++ b/tables/item_listing.lua
@@ -60,7 +60,7 @@ function public.create(parent, on_click, selected)
scrollBar:SetWidth(12)
local thumbTex = scrollBar:GetThumbTexture()
thumbTex:SetPoint('CENTER', 0, 0)
- thumbTex:SetTexture(unpack(aux.gui.color.content.backdrop))
+ thumbTex:SetTexture(unpack(aux.gui.color.content.background))
thumbTex:SetHeight(50)
thumbTex:SetWidth(12)
getglobal(scrollBar:GetName()..'ScrollUpButton'):Hide()
diff --git a/tables/listing.lua b/tables/listing.lua
index 4082460..e809bb5 100644
--- a/tables/listing.lua
+++ b/tables/listing.lua
@@ -432,7 +432,7 @@ function public.CreateScrollingTable(parent)
st.scrollBar = scrollBar
local thumbTex = scrollBar:GetThumbTexture()
thumbTex:SetPoint('CENTER', 0, 0)
- thumbTex:SetTexture(unpack(aux.gui.color.content.backdrop))
+ thumbTex:SetTexture(unpack(aux.gui.color.content.background))
thumbTex:SetHeight(50)
thumbTex:SetWidth(12)
getglobal(scrollBar:GetName()..'ScrollUpButton'):Hide()
diff --git a/tabs/search/filter.lua b/tabs/search/filter.lua
index 2853f81..22c3cee 100644
--- a/tabs/search/filter.lua
+++ b/tabs/search/filter.lua
@@ -223,12 +223,12 @@ function public.formatted_post_filter(components)
elseif i > 1 then
str = str..'
'
for _=1,getn(stack) do
- str = str..aux.gui.color.content.backdrop('----')
+ str = str..aux.gui.color.content.background('----')
end
end
no_line_break = component[1] == 'operator' and component[2] == 'not'
- local filter_color = (m.filter_builder_state.selected == i and aux.gui.color.green or aux.gui.color.yellow)
+ local filter_color = (m.filter_builder_state.selected == i and aux.gui.color.orange or aux.gui.color.aux)
local component_text = filter_color(component[2])
if component[1] == 'operator' and component[2] ~= 'not' then
component_text = component_text..filter_color(tonumber(component[3]) or '')
@@ -236,11 +236,9 @@ function public.formatted_post_filter(components)
elseif component[1] == 'filter' then
for parameter in aux.util.present(component[3]) do
if component[2] == 'item' then
- parameter = aux.info.display_name(aux.cache.item_id(parameter)) or aux.gui.color.orange('['..parameter..']')
+ parameter = aux.info.display_name(aux.cache.item_id(parameter)) or '['..parameter..']'
elseif aux.filter.filters[component[2]].input_type == 'money' then
- parameter = aux.money.to_string(aux.money.from_string(parameter), nil, true, nil, aux.auction_listing.colors.ORANGE)
- else
- parameter = aux.gui.color.orange(parameter)
+ parameter = aux.money.to_string(aux.money.from_string(parameter), nil, true)
end
component_text = component_text..filter_color(': ')..parameter
end
@@ -355,11 +353,13 @@ function private.initialize_filter_dropdown()
value = filter,
func = function()
m.filter_input:SetText(this.value)
- if aux.filter.filters[this.value] and aux.filter.filters[this.value].input_type ~= '' then
+ if aux.index(aux.filter.filters[this.value], 'input_type') == '' or this.value == 'not' then
+ m.add_post_filter()
+ elseif aux.filter.filters[this.value] then
m.filter_parameter_input:Show()
m.filter_parameter_input:SetFocus()
else
- m.add_post_filter()
+ m.filter_input:SetFocus()
end
end,
}
diff --git a/tabs/search/frames.lua b/tabs/search/frames.lua
index a59e493..7519662 100644
--- a/tabs/search/frames.lua
+++ b/tabs/search/frames.lua
@@ -54,7 +54,7 @@ function private.create_frames()
do
local panel = CreateFrame('Frame', nil, m.frame)
panel:SetBackdrop{bgFile=[[Interface\Buttons\WHITE8X8]]}
- panel:SetBackdropColor(unpack(aux.gui.color.content.backdrop))
+ panel:SetBackdropColor(unpack(aux.gui.color.content.background))
panel:SetPoint('LEFT', m.settings_button, 'RIGHT', 0, 0)
panel:SetPoint('RIGHT', 0, 0)
panel:SetHeight(42)
@@ -565,7 +565,7 @@ function private.create_frames()
input:SetPoint('LEFT', m.filter_dropdown, 'RIGHT', 10, 0)
input:SetWidth(150)
input:SetScript('OnTabPressed', function()
- m.filter_parameter_input:SetFocus()
+ m.filter_input:SetFocus()
end)
input:SetScript('OnChar', function()
this:complete()
@@ -609,6 +609,7 @@ function private.create_frames()
local scroll_child = CreateFrame('SimpleHTML', nil, scroll_frame)
scroll_frame:SetScrollChild(scroll_child)
scroll_child:SetFont('p', [[Fonts\ARIALN.TTF]], 23)
+ scroll_child:SetTextColor('p', aux.gui.color.label.enabled())
scroll_child:SetWidth(1)
scroll_child:SetHeight(1)
scroll_child:SetScript('OnHyperlinkClick', m.data_link_click)
diff --git a/util/filter.lua b/util/filter.lua
index dcb45d4..25d2f4d 100644
--- a/util/filter.lua
+++ b/util/filter.lua
@@ -540,31 +540,31 @@ function private.prettified_query_string(components)
for _, filter in components.blizzard do
blizzard_filters[filter[1]] = filter[2] or true
if filter[1] == 'exact' then
- prettified.prepend(aux.info.display_name(aux.cache.item_id(m.unquote(blizzard_filters.name))) or aux.gui.inline_color.label.enabled..'['..m.unquote(blizzard_filters.name)..']'..FONT_COLOR_CODE_CLOSE)
+ prettified.prepend(aux.info.display_name(aux.cache.item_id(m.unquote(blizzard_filters.name))) or aux.gui.color.blizzard('['..m.unquote(blizzard_filters.name)..']'))
elseif filter[1] ~= 'name' then
- prettified.append(aux.gui.inline_color.label.enabled..(filter[2] or filter[1])..FONT_COLOR_CODE_CLOSE)
+ prettified.append(aux.gui.color.blizzard(filter[2] or filter[1]))
end
end
if blizzard_filters.name and not blizzard_filters.exact and blizzard_filters.name ~= '' then
- prettified.prepend(aux.gui.inline_color.label.enabled..m.unquote(blizzard_filters.name)..FONT_COLOR_CODE_CLOSE)
+ prettified.prepend(aux.gui.color.blizzard(m.unquote(blizzard_filters.name)))
end
for _, component in components.post do
if component[1] == 'operator' then
- prettified.append(aux.auction_listing.colors.YELLOW..component[2]..(component[2] ~= 'not' and tonumber(component[3]) or '')..FONT_COLOR_CODE_CLOSE)
+ prettified.append(aux.gui.color.aux(component[2]..(component[2] ~= 'not' and tonumber(component[3]) or '')))
elseif component[1] == 'filter' then
if component[2] ~= 'tooltip' then
- prettified.append(aux.gui.color.yellow(component[2]))
+ prettified.append(aux.gui.color.aux(component[2]))
end
for parameter in aux.util.present(component[3]) do
if component[2] == 'item' then
- prettified.append(aux.info.display_name(aux.cache.item_id(parameter)) or aux.gui.color.orange('['..parameter..']'))
+ prettified.append(aux.info.display_name(aux.cache.item_id(parameter)) or aux.gui.color.label.enabled('['..parameter..']'))
else
if m.filters[component[2]].input_type == 'money' then
- prettified.append(aux.money.to_string(aux.money.from_string(parameter), nil, true, nil, aux.auction_listing.colors.ORANGE))
+ prettified.append(aux.money.to_string(aux.money.from_string(parameter), nil, true, nil, aux.gui.inline_color.label.enabled))
else
- prettified.append(aux.gui.color.orange(parameter))
+ prettified.append(aux.gui.color.label.enabled(parameter))
end
end
end