|
39 | 39 | function PANEL:Paint(w, h) |
40 | 40 | if not self:IsEnabled() then |
41 | 41 | PIXEL.DrawRoundedBox(PIXEL.Scale(4), 0, 0, w, h, self.DisabledCol) |
42 | | - PIXEL.DrawSimpleText("Disabled", "UI.TextEntry", PIXEL.Scale(4), h / 2, PIXEL.Colors.SecondaryText, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER) |
| 42 | + PIXEL.DrawSimpleText("Disabled", self:GetFont(), PIXEL.Scale(4), h / 2, PIXEL.Colors.SecondaryText, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER) |
43 | 43 | return |
44 | 44 | end |
45 | 45 |
|
46 | 46 | if self:GetValue() == "" then |
47 | | - PIXEL.DrawSimpleText(self:GetPlaceholderText() or "", "UI.TextEntry", PIXEL.Scale(10), h / 2, self.PlaceholderTextCol, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER) |
| 47 | + local placeholderY = self:IsMultiline() and draw.GetFontHeight(self:GetFont()) or h / 2 |
| 48 | + PIXEL.DrawSimpleText(self:GetPlaceholderText() or "", self:GetFont(), PIXEL.Scale(10), placeholderY, self.PlaceholderTextCol, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER) |
48 | 49 | end |
49 | 50 |
|
50 | 51 | local outlineThickness = PIXEL.Scale(1) |
@@ -97,6 +98,9 @@ function PANEL:SetTabbingDisabled(disabled) self.TextEntry:SetTabbingDisabled(di |
97 | 98 | function PANEL:GetPlaceholderText() return self.TextEntry:GetPlaceholderText() end |
98 | 99 | function PANEL:SetPlaceholderText(text) self.TextEntry:SetPlaceholderText(text) end |
99 | 100 |
|
| 101 | +function PANEL:GetFont() return self.TextEntry:GetFont() end |
| 102 | +function PANEL:SetFont(font) self.TextEntry:SetFontInternal(font) end |
| 103 | + |
100 | 104 | function PANEL:GetInt() return self.TextEntry:GetInt() end |
101 | 105 | function PANEL:GetFloat() return self.TextEntry:GetFloat() end |
102 | 106 |
|
|
0 commit comments