2017-09-21 00:46:03 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "HeadlessThemeGTK.h"
|
2018-07-16 21:09:42 +03:00
|
|
|
|
2019-07-26 04:10:23 +03:00
|
|
|
#include "mozilla/StaticPrefs_layout.h"
|
2018-07-25 16:03:45 +03:00
|
|
|
#include "nsStyleConsts.h"
|
2017-09-21 00:46:03 +03:00
|
|
|
#include "nsIFrame.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace widget {
|
|
|
|
|
|
|
|
NS_IMPL_ISUPPORTS_INHERITED(HeadlessThemeGTK, nsNativeTheme, nsITheme)
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HeadlessThemeGTK::DrawWidgetBackground(gfxContext* aContext, nsIFrame* aFrame,
|
2018-10-24 18:24:57 +03:00
|
|
|
StyleAppearance aAppearance,
|
2017-09-21 00:46:03 +03:00
|
|
|
const nsRect& aRect,
|
|
|
|
const nsRect& aDirtyRect) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2020-12-03 02:11:32 +03:00
|
|
|
LayoutDeviceIntMargin HeadlessThemeGTK::GetWidgetBorder(
|
2017-09-21 00:46:03 +03:00
|
|
|
nsDeviceContext* aContext, nsIFrame* aFrame, StyleAppearance aAppearance) {
|
2020-12-03 02:11:32 +03:00
|
|
|
LayoutDeviceIntMargin result;
|
2017-09-21 00:46:03 +03:00
|
|
|
// The following values are generated from the Ubuntu GTK theme.
|
2018-10-24 18:24:57 +03:00
|
|
|
switch (aAppearance) {
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Button:
|
|
|
|
case StyleAppearance::Toolbarbutton:
|
2018-06-02 20:10:48 +03:00
|
|
|
result.top = 6;
|
|
|
|
result.right = 7;
|
|
|
|
result.bottom = 6;
|
|
|
|
result.left = 7;
|
2017-09-21 00:46:03 +03:00
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::FocusOutline:
|
|
|
|
case StyleAppearance::NumberInput:
|
|
|
|
case StyleAppearance::Textfield:
|
2018-06-02 20:10:48 +03:00
|
|
|
result.top = 5;
|
|
|
|
result.right = 7;
|
|
|
|
result.bottom = 5;
|
|
|
|
result.left = 7;
|
2017-09-21 00:46:03 +03:00
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Statusbarpanel:
|
|
|
|
case StyleAppearance::Resizerpanel:
|
|
|
|
case StyleAppearance::Listbox:
|
|
|
|
case StyleAppearance::Treeview:
|
|
|
|
case StyleAppearance::Treeheadersortarrow:
|
2018-11-09 06:25:56 +03:00
|
|
|
case StyleAppearance::ProgressBar:
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::SpinnerUpbutton:
|
|
|
|
case StyleAppearance::SpinnerDownbutton:
|
|
|
|
case StyleAppearance::SpinnerTextfield:
|
2018-11-22 00:05:20 +03:00
|
|
|
case StyleAppearance::Textarea:
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Menupopup:
|
|
|
|
case StyleAppearance::MozGtkInfoBar:
|
2018-06-02 20:10:48 +03:00
|
|
|
result.top = 1;
|
|
|
|
result.right = 1;
|
|
|
|
result.bottom = 1;
|
|
|
|
result.left = 1;
|
2017-09-21 00:46:03 +03:00
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Treeheadercell:
|
2018-06-02 20:10:48 +03:00
|
|
|
result.top = 5;
|
|
|
|
result.right = 7;
|
|
|
|
result.bottom = 6;
|
|
|
|
result.left = 6;
|
2017-09-21 00:46:03 +03:00
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Tab:
|
2018-06-02 20:10:48 +03:00
|
|
|
result.top = 4;
|
|
|
|
result.right = 7;
|
|
|
|
result.bottom = 2;
|
|
|
|
result.left = 7;
|
2017-09-21 00:46:03 +03:00
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Tooltip:
|
2018-06-02 20:10:48 +03:00
|
|
|
result.top = 6;
|
|
|
|
result.right = 6;
|
|
|
|
result.bottom = 6;
|
|
|
|
result.left = 6;
|
2017-09-21 00:46:03 +03:00
|
|
|
break;
|
2020-02-19 17:48:43 +03:00
|
|
|
case StyleAppearance::MenulistButton:
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Menulist:
|
2018-06-02 20:10:48 +03:00
|
|
|
result.top = 6;
|
|
|
|
result.right = 22;
|
|
|
|
result.bottom = 6;
|
|
|
|
result.left = 7;
|
2017-09-21 00:46:03 +03:00
|
|
|
break;
|
2020-03-06 00:13:46 +03:00
|
|
|
case StyleAppearance::MozMenulistArrowButton:
|
2018-06-02 20:10:48 +03:00
|
|
|
result.top = 1;
|
|
|
|
result.right = 1;
|
|
|
|
result.bottom = 1;
|
|
|
|
result.left = 0;
|
2017-09-21 00:46:03 +03:00
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Menuitem:
|
|
|
|
case StyleAppearance::Checkmenuitem:
|
|
|
|
case StyleAppearance::Radiomenuitem:
|
2017-09-21 00:46:03 +03:00
|
|
|
if (IsRegularMenuItem(aFrame)) {
|
|
|
|
break;
|
|
|
|
}
|
2018-06-02 20:10:48 +03:00
|
|
|
result.top = 3;
|
|
|
|
result.right = 5;
|
|
|
|
result.bottom = 3;
|
|
|
|
result.left = 5;
|
2017-09-21 00:46:03 +03:00
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
default:
|
|
|
|
break;
|
2017-09-21 00:46:03 +03:00
|
|
|
}
|
2018-06-02 20:10:48 +03:00
|
|
|
return result;
|
2017-09-21 00:46:03 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool HeadlessThemeGTK::GetWidgetPadding(nsDeviceContext* aContext,
|
2018-10-24 14:47:20 +03:00
|
|
|
nsIFrame* aFrame,
|
2018-10-24 18:24:57 +03:00
|
|
|
StyleAppearance aAppearance,
|
2020-12-03 02:11:32 +03:00
|
|
|
LayoutDeviceIntMargin* aResult) {
|
2017-09-21 00:46:03 +03:00
|
|
|
// The following values are generated from the Ubuntu GTK theme.
|
2018-10-24 18:24:57 +03:00
|
|
|
switch (aAppearance) {
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Radio:
|
|
|
|
case StyleAppearance::Checkbox:
|
|
|
|
case StyleAppearance::Toolbarbutton:
|
|
|
|
case StyleAppearance::Dualbutton:
|
|
|
|
case StyleAppearance::ToolbarbuttonDropdown:
|
|
|
|
case StyleAppearance::ButtonArrowUp:
|
|
|
|
case StyleAppearance::ButtonArrowDown:
|
|
|
|
case StyleAppearance::ButtonArrowNext:
|
|
|
|
case StyleAppearance::ButtonArrowPrevious:
|
|
|
|
case StyleAppearance::TabScrollArrowBack:
|
|
|
|
case StyleAppearance::TabScrollArrowForward:
|
2020-03-06 00:13:46 +03:00
|
|
|
case StyleAppearance::MozMenulistArrowButton:
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::RangeThumb:
|
|
|
|
case StyleAppearance::ButtonFocus:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->top = 0;
|
|
|
|
aResult->right = 0;
|
|
|
|
aResult->bottom = 0;
|
|
|
|
aResult->left = 0;
|
|
|
|
return true;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Menuitem:
|
|
|
|
case StyleAppearance::Checkmenuitem:
|
|
|
|
case StyleAppearance::Radiomenuitem:
|
2017-09-21 00:46:03 +03:00
|
|
|
if (!IsRegularMenuItem(aFrame)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
aResult->top = 3;
|
|
|
|
aResult->right = 5;
|
|
|
|
aResult->bottom = 3;
|
|
|
|
aResult->left = 5;
|
|
|
|
return true;
|
2018-07-25 16:03:45 +03:00
|
|
|
default:
|
|
|
|
break;
|
2017-09-21 00:46:03 +03:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HeadlessThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
|
2018-10-24 14:47:20 +03:00
|
|
|
nsIFrame* aFrame,
|
2018-10-24 18:24:57 +03:00
|
|
|
StyleAppearance aAppearance,
|
2020-12-03 02:11:32 +03:00
|
|
|
LayoutDeviceIntSize* aResult,
|
2017-09-21 00:46:03 +03:00
|
|
|
bool* aIsOverridable) {
|
|
|
|
aResult->width = aResult->height = 0;
|
|
|
|
*aIsOverridable = true;
|
|
|
|
|
|
|
|
// The following values are generated from the Ubuntu GTK theme.
|
2018-10-24 18:24:57 +03:00
|
|
|
switch (aAppearance) {
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Splitter:
|
2017-09-21 00:46:03 +03:00
|
|
|
if (IsHorizontal(aFrame)) {
|
|
|
|
aResult->width = 6;
|
|
|
|
aResult->height = 0;
|
|
|
|
} else {
|
|
|
|
aResult->width = 0;
|
|
|
|
aResult->height = 6;
|
|
|
|
}
|
|
|
|
*aIsOverridable = false;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Button:
|
|
|
|
case StyleAppearance::Toolbarbutton:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 14;
|
|
|
|
aResult->height = 12;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Radio:
|
|
|
|
case StyleAppearance::Checkbox:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 18;
|
|
|
|
aResult->height = 18;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::ToolbarbuttonDropdown:
|
|
|
|
case StyleAppearance::ButtonArrowUp:
|
|
|
|
case StyleAppearance::ButtonArrowDown:
|
|
|
|
case StyleAppearance::ButtonArrowNext:
|
|
|
|
case StyleAppearance::ButtonArrowPrevious:
|
|
|
|
case StyleAppearance::Resizer:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 15;
|
|
|
|
aResult->height = 15;
|
|
|
|
*aIsOverridable = false;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Separator:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 12;
|
|
|
|
aResult->height = 0;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Treetwisty:
|
|
|
|
case StyleAppearance::Treetwistyopen:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 8;
|
|
|
|
aResult->height = 8;
|
|
|
|
*aIsOverridable = false;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Treeheadercell:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 13;
|
|
|
|
aResult->height = 11;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Treeheadersortarrow:
|
|
|
|
case StyleAppearance::SpinnerUpbutton:
|
|
|
|
case StyleAppearance::SpinnerDownbutton:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 14;
|
|
|
|
aResult->height = 13;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::TabScrollArrowBack:
|
|
|
|
case StyleAppearance::TabScrollArrowForward:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 16;
|
|
|
|
aResult->height = 16;
|
|
|
|
*aIsOverridable = false;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Spinner:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 14;
|
|
|
|
aResult->height = 26;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::NumberInput:
|
|
|
|
case StyleAppearance::Textfield:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 0;
|
|
|
|
aResult->height = 12;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::ScrollbarHorizontal:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 31;
|
|
|
|
aResult->height = 10;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::ScrollbarVertical:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 10;
|
|
|
|
aResult->height = 31;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::ScrollbarbuttonUp:
|
|
|
|
case StyleAppearance::ScrollbarbuttonDown:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 10;
|
|
|
|
aResult->height = 13;
|
|
|
|
*aIsOverridable = false;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::ScrollbarbuttonLeft:
|
|
|
|
case StyleAppearance::ScrollbarbuttonRight:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 13;
|
|
|
|
aResult->height = 10;
|
|
|
|
*aIsOverridable = false;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::ScrollbarthumbHorizontal:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 31;
|
|
|
|
aResult->height = 10;
|
|
|
|
*aIsOverridable = false;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::ScrollbarthumbVertical:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 10;
|
|
|
|
aResult->height = 31;
|
|
|
|
*aIsOverridable = false;
|
|
|
|
break;
|
2020-02-19 17:48:43 +03:00
|
|
|
case StyleAppearance::MenulistButton:
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Menulist:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 44;
|
|
|
|
aResult->height = 27;
|
|
|
|
break;
|
2020-03-06 00:13:46 +03:00
|
|
|
case StyleAppearance::MozMenulistArrowButton:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 29;
|
|
|
|
aResult->height = 28;
|
|
|
|
*aIsOverridable = false;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::RangeThumb:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 14;
|
|
|
|
aResult->height = 18;
|
|
|
|
*aIsOverridable = false;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Menuseparator:
|
2017-09-21 00:46:03 +03:00
|
|
|
aResult->width = 0;
|
|
|
|
aResult->height = 8;
|
|
|
|
*aIsOverridable = false;
|
|
|
|
break;
|
2018-07-25 16:03:45 +03:00
|
|
|
default:
|
|
|
|
break;
|
2017-09-21 00:46:03 +03:00
|
|
|
}
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2018-10-24 14:47:20 +03:00
|
|
|
HeadlessThemeGTK::WidgetStateChanged(nsIFrame* aFrame,
|
2018-10-24 18:24:57 +03:00
|
|
|
StyleAppearance aAppearance,
|
2018-10-24 14:47:20 +03:00
|
|
|
nsAtom* aAttribute, bool* aShouldRepaint,
|
2017-09-21 00:46:03 +03:00
|
|
|
const nsAttrValue* aOldValue) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HeadlessThemeGTK::ThemeChanged() { return NS_OK; }
|
|
|
|
|
|
|
|
static bool IsFrameContentNodeInNamespace(nsIFrame* aFrame,
|
|
|
|
uint32_t aNamespace) {
|
|
|
|
nsIContent* content = aFrame ? aFrame->GetContent() : nullptr;
|
|
|
|
if (!content) return false;
|
|
|
|
return content->IsInNamespace(aNamespace);
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP_(bool)
|
|
|
|
HeadlessThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext,
|
|
|
|
nsIFrame* aFrame,
|
2018-10-24 18:24:57 +03:00
|
|
|
StyleAppearance aAppearance) {
|
|
|
|
switch (aAppearance) {
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Button:
|
|
|
|
case StyleAppearance::Radio:
|
|
|
|
case StyleAppearance::Checkbox:
|
|
|
|
case StyleAppearance::FocusOutline:
|
|
|
|
case StyleAppearance::Toolbox:
|
|
|
|
case StyleAppearance::Toolbar:
|
|
|
|
case StyleAppearance::Toolbarbutton:
|
|
|
|
case StyleAppearance::Dualbutton:
|
|
|
|
case StyleAppearance::ToolbarbuttonDropdown:
|
|
|
|
case StyleAppearance::ButtonArrowUp:
|
|
|
|
case StyleAppearance::ButtonArrowDown:
|
|
|
|
case StyleAppearance::ButtonArrowNext:
|
|
|
|
case StyleAppearance::ButtonArrowPrevious:
|
|
|
|
case StyleAppearance::Separator:
|
|
|
|
case StyleAppearance::Toolbargripper:
|
|
|
|
case StyleAppearance::Splitter:
|
|
|
|
case StyleAppearance::Statusbar:
|
|
|
|
case StyleAppearance::Statusbarpanel:
|
|
|
|
case StyleAppearance::Resizerpanel:
|
|
|
|
case StyleAppearance::Resizer:
|
|
|
|
case StyleAppearance::Listbox:
|
|
|
|
case StyleAppearance::Treeview:
|
|
|
|
case StyleAppearance::Treetwisty:
|
|
|
|
case StyleAppearance::Treeheadercell:
|
|
|
|
case StyleAppearance::Treeheadersortarrow:
|
|
|
|
case StyleAppearance::Treetwistyopen:
|
2018-11-09 06:25:56 +03:00
|
|
|
case StyleAppearance::ProgressBar:
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Progresschunk:
|
|
|
|
case StyleAppearance::Tab:
|
|
|
|
case StyleAppearance::Tabpanels:
|
|
|
|
case StyleAppearance::TabScrollArrowBack:
|
|
|
|
case StyleAppearance::TabScrollArrowForward:
|
|
|
|
case StyleAppearance::Tooltip:
|
|
|
|
case StyleAppearance::Spinner:
|
|
|
|
case StyleAppearance::SpinnerUpbutton:
|
|
|
|
case StyleAppearance::SpinnerDownbutton:
|
|
|
|
case StyleAppearance::SpinnerTextfield:
|
|
|
|
case StyleAppearance::NumberInput:
|
|
|
|
case StyleAppearance::ScrollbarHorizontal:
|
|
|
|
case StyleAppearance::ScrollbarVertical:
|
|
|
|
case StyleAppearance::ScrollbarbuttonUp:
|
|
|
|
case StyleAppearance::ScrollbarbuttonDown:
|
|
|
|
case StyleAppearance::ScrollbarbuttonLeft:
|
|
|
|
case StyleAppearance::ScrollbarbuttonRight:
|
|
|
|
case StyleAppearance::ScrollbartrackHorizontal:
|
|
|
|
case StyleAppearance::ScrollbartrackVertical:
|
|
|
|
case StyleAppearance::ScrollbarthumbHorizontal:
|
|
|
|
case StyleAppearance::ScrollbarthumbVertical:
|
|
|
|
case StyleAppearance::Textfield:
|
2018-11-22 00:05:20 +03:00
|
|
|
case StyleAppearance::Textarea:
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::Menulist:
|
2020-02-19 17:48:43 +03:00
|
|
|
case StyleAppearance::MenulistButton:
|
2018-07-25 16:03:45 +03:00
|
|
|
case StyleAppearance::MenulistText:
|
|
|
|
case StyleAppearance::Range:
|
|
|
|
case StyleAppearance::RangeThumb:
|
|
|
|
case StyleAppearance::CheckboxContainer:
|
|
|
|
case StyleAppearance::RadioContainer:
|
|
|
|
case StyleAppearance::CheckboxLabel:
|
|
|
|
case StyleAppearance::RadioLabel:
|
|
|
|
case StyleAppearance::ButtonFocus:
|
|
|
|
case StyleAppearance::Window:
|
|
|
|
case StyleAppearance::Dialog:
|
|
|
|
case StyleAppearance::Menubar:
|
|
|
|
case StyleAppearance::Menupopup:
|
|
|
|
case StyleAppearance::Menuitem:
|
|
|
|
case StyleAppearance::Checkmenuitem:
|
|
|
|
case StyleAppearance::Radiomenuitem:
|
|
|
|
case StyleAppearance::Menuseparator:
|
|
|
|
case StyleAppearance::Menuarrow:
|
|
|
|
case StyleAppearance::MozGtkInfoBar:
|
2018-10-24 18:24:57 +03:00
|
|
|
return !IsWidgetStyled(aPresContext, aFrame, aAppearance);
|
2020-03-06 00:13:46 +03:00
|
|
|
case StyleAppearance::MozMenulistArrowButton:
|
2017-09-21 00:46:03 +03:00
|
|
|
return (!aFrame ||
|
|
|
|
IsFrameContentNodeInNamespace(aFrame, kNameSpaceID_XUL)) &&
|
2018-10-24 18:24:57 +03:00
|
|
|
!IsWidgetStyled(aPresContext, aFrame, aAppearance);
|
2018-07-25 16:03:45 +03:00
|
|
|
default:
|
|
|
|
break;
|
2017-09-21 00:46:03 +03:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP_(bool)
|
2018-10-24 18:24:57 +03:00
|
|
|
HeadlessThemeGTK::WidgetIsContainer(StyleAppearance aAppearance) {
|
2020-03-06 00:13:46 +03:00
|
|
|
if (aAppearance == StyleAppearance::MozMenulistArrowButton ||
|
2018-10-24 18:24:57 +03:00
|
|
|
aAppearance == StyleAppearance::Radio ||
|
|
|
|
aAppearance == StyleAppearance::RangeThumb ||
|
|
|
|
aAppearance == StyleAppearance::Checkbox ||
|
|
|
|
aAppearance == StyleAppearance::TabScrollArrowBack ||
|
|
|
|
aAppearance == StyleAppearance::TabScrollArrowForward ||
|
|
|
|
aAppearance == StyleAppearance::ButtonArrowUp ||
|
|
|
|
aAppearance == StyleAppearance::ButtonArrowDown ||
|
|
|
|
aAppearance == StyleAppearance::ButtonArrowNext ||
|
|
|
|
aAppearance == StyleAppearance::ButtonArrowPrevious) {
|
2017-09-21 00:46:03 +03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-10-24 18:24:57 +03:00
|
|
|
bool HeadlessThemeGTK::ThemeDrawsFocusForWidget(StyleAppearance aAppearance) {
|
|
|
|
if (aAppearance == StyleAppearance::Menulist ||
|
|
|
|
aAppearance == StyleAppearance::Button ||
|
|
|
|
aAppearance == StyleAppearance::Treeheadercell) {
|
2017-09-21 00:46:03 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool HeadlessThemeGTK::ThemeNeedsComboboxDropmarker() { return false; }
|
|
|
|
|
|
|
|
} // namespace widget
|
|
|
|
} // namespace mozilla
|