Add Show/Hide Title bar option.

This commit is contained in:
Xinhuan
2008-10-30 12:09:51 +08:00
parent b05e63e6f9
commit 8ff091dcbf
7 changed files with 48 additions and 3 deletions
+2
View File
@@ -62,6 +62,8 @@ L["Sets how far inside the frame the threat bars will display from the 4 borders
-- Config strings, title bar section
L["Title Bar Settings"] = "Optionen für die Titelleiste"
L["Configure title bar settings."] = "Einstellungen für die Titelleiste ändern"
L["Show Title Bar"] = true
L["Show the Omen Title Bar"] = true
L["Title Bar Height"] = "Höhe der Titelleisten"
L["Height of the title bar. The minimum height allowed is twice the background border thickness."] = "Höhe der Titelleisten. Die minimal erlaubte Höhe ist doppelt so dick wie der Rand des Hintergrundfensters"
L["Title Text Options"] = "Optionen für den Titeltext"
+2
View File
@@ -62,6 +62,8 @@ L["Sets how far inside the frame the threat bars will display from the 4 borders
-- Config strings, title bar section
L["Title Bar Settings"] = true
L["Configure title bar settings."] = true
L["Show Title Bar"] = true
L["Show the Omen Title Bar"] = true
L["Title Bar Height"] = true
L["Height of the title bar. The minimum height allowed is twice the background border thickness."] = true
L["Title Text Options"] = true
+2
View File
@@ -62,6 +62,8 @@ L["Sets how far inside the frame the threat bars will display from the 4 borders
-- Config strings, title bar section
L["Title Bar Settings"] = "Param. du titre"
L["Configure title bar settings."] = "Configure les paramètres de la barre du titre."
L["Show Title Bar"] = true
L["Show the Omen Title Bar"] = true
L["Title Bar Height"] = "Hauteur de la barre-titre"
L["Height of the title bar. The minimum height allowed is twice the background border thickness."] = "Hauteur de la barre du titre. La hauteur minimale autorisée est le double de l'épaisseur de la bordure de l'arrière-plan."
L["Title Text Options"] = "Options du texte du titre"
+2
View File
@@ -62,6 +62,8 @@ L["Sets how far inside the frame the threat bars will display from the 4 borders
-- Config strings, title bar section
L["Title Bar Settings"] = "제목 바 설정"
L["Configure title bar settings."] = "제목 바를 설정합니다."
L["Show Title Bar"] = true
L["Show the Omen Title Bar"] = true
L["Title Bar Height"] = "제목 바 높이"
L["Height of the title bar. The minimum height allowed is twice the background border thickness."] = "제목 바의 높이를 설정합니다. 최소 허락된 높이는 배경 테두리 두께입니다."
L["Title Text Options"] = "제목 문자 옵션"
+2
View File
@@ -62,6 +62,8 @@ L["Sets how far inside the frame the threat bars will display from the 4 borders
-- Config strings, title bar section
L["Title Bar Settings"] = "标题栏设置"
L["Configure title bar settings."] = "配置标题栏设置"
L["Show Title Bar"] = true
L["Show the Omen Title Bar"] = true
L["Title Bar Height"] = "标题栏高度"
L["Height of the title bar. The minimum height allowed is twice the background border thickness."] = "标题栏高度。最小厚度为背景边框厚度的一倍。"
L["Title Text Options"] = "标题文本选项"
+2
View File
@@ -62,6 +62,8 @@ L["Sets how far inside the frame the threat bars will display from the 4 borders
-- Config strings, title bar section
L["Title Bar Settings"] = "標題條的設定"
L["Configure title bar settings."] = "設定標題條"
L["Show Title Bar"] = true
L["Show the Omen Title Bar"] = true
L["Title Bar Height"] = "標題條的高度"
L["Height of the title bar. The minimum height allowed is twice the background border thickness."] = "標題條厚度. 厚度的最小值是背景邊緣厚度的一倍"
L["Title Text Options"] = "標題設定"
+36 -3
View File
@@ -90,6 +90,7 @@ local defaults = {
FontOutline = "",
FontColor = {r = 1, g = 1, b = 1, a = 1,},
FontSize = 10,
ShowTitleBar = true,
},
Bar = {
Texture = "Blizzard",
@@ -645,7 +646,9 @@ function Omen:UpdateBackdrop()
local h = db.Background.EdgeSize * 2
self.Anchor:SetMinResize(90, h)
self.Title:SetMinResize(90, h)
if h > db.TitleBar.Height then
if not db.TitleBar.ShowTitleBar then
self.Title:SetHeight(0.0000000001) -- See comment in Omen:UpdateTitleBar()
elseif h > db.TitleBar.Height then
self.Title:SetHeight(h)
else
self.Title:SetHeight(db.TitleBar.Height)
@@ -654,6 +657,12 @@ function Omen:UpdateBackdrop()
--self.FocusButton:SetPoint("TOPRIGHT", -inset, -inset)
self.BarList:ClearAllPoints() -- See comment in Omen:UpdateTitleBar()
self.BarList:SetPoint("TOPLEFT", self.Title, "BOTTOMLEFT")
self.BarList:SetPoint("TOPRIGHT", self.Title, "BOTTOMRIGHT")
self.BarList:SetPoint("BOTTOMLEFT", self.Anchor, "BOTTOMLEFT")
self.BarList:SetPoint("BOTTOMRIGHT", self.Anchor, "BOTTOMRIGHT")
self:ResizeBars()
self:ReAnchorBars()
self:UpdateBars()
@@ -666,11 +675,24 @@ function Omen:UpdateTitleBar()
local color = db.TitleBar.FontColor
self.TitleText:SetFont(font, size, flags)
self.TitleText:SetTextColor(color.r, color.g, color.b, color.a)
if db.Background.EdgeSize * 2 > db.TitleBar.Height then
if not db.TitleBar.ShowTitleBar then
-- Yes, its a hack, since it can't be set to 0
self.Title:SetHeight(0.0000000001)
self.Title:Hide()
elseif db.Background.EdgeSize * 2 > db.TitleBar.Height then
self.Title:SetHeight(db.Background.EdgeSize * 2)
self.Title:Show()
else
self.Title:SetHeight(db.TitleBar.Height)
self.Title:Show()
end
-- This forces the UI to redraw it, I couldn't find a better way. Although it is
-- anchored to the Title, it doesn't update automatically on the height change.
self.BarList:ClearAllPoints()
self.BarList:SetPoint("TOPLEFT", self.Title, "BOTTOMLEFT")
self.BarList:SetPoint("TOPRIGHT", self.Title, "BOTTOMRIGHT")
self.BarList:SetPoint("BOTTOMLEFT", self.Anchor, "BOTTOMLEFT")
self.BarList:SetPoint("BOTTOMRIGHT", self.Anchor, "BOTTOMRIGHT")
end
function Omen:UpdateFuBarSettings()
@@ -1868,6 +1890,7 @@ local options = {
set = function(info, value)
db.TitleBar[ info[#info] ] = value
Omen:UpdateTitleBar()
Omen:UpdateBars()
end,
args = {
intro = {
@@ -1875,9 +1898,15 @@ local options = {
type = "description",
name = L["Configure title bar settings."],
},
ShowTitleBar = {
type = "toggle",
order = 2,
name = L["Show Title Bar"],
desc = L["Show the Omen Title Bar"],
},
Height = {
type = "range",
order = 2,
order = 5,
name = L["Title Bar Height"],
desc = L["Height of the title bar. The minimum height allowed is twice the background border thickness."],
min = 2, max = 32, step = 1,
@@ -1887,6 +1916,10 @@ local options = {
name = L["Title Text Options"],
guiInline = true,
order = 20,
set = function(info, value)
db.TitleBar[ info[#info] ] = value
Omen:UpdateTitleBar()
end,
args = {
Font = {
type = "select", dialogControl = 'LSM30_Font',