зеркало из https://github.com/mozilla/gecko-dev.git
Remove unused system metrics from nsILookAndFeel and implementations. (Bug 599657) r=roc a2.0=joedrew
This commit is contained in:
Родитель
737344d8c9
Коммит
a4497ad7d8
|
@ -43,11 +43,10 @@
|
|||
// for |#ifdef NS_DEBUG|
|
||||
struct nsSize;
|
||||
|
||||
|
||||
// {3fd2930f-1040-4d08-b638-0b3f134e6b6f}
|
||||
// 2e89c566-0a31-4c93-bdff-222651df45a0
|
||||
#define NS_ILOOKANDFEEL_IID \
|
||||
{ 0xc23ca876, 0x6ecf, 0x49c6, \
|
||||
{ 0xb2, 0xb4, 0x5b, 0xe5, 0x16, 0xb5, 0x0e, 0x28 } }
|
||||
{ 0x2e89c566, 0x0a31, 0x4c93, \
|
||||
{ 0xbd, 0xff, 0x22, 0x26, 0x51, 0xdf, 0x45, 0xa0 } }
|
||||
|
||||
class nsILookAndFeel: public nsISupports {
|
||||
public:
|
||||
|
@ -179,27 +178,6 @@ public:
|
|||
// When modifying this list, also modify nsXPLookAndFeel::sIntPrefs
|
||||
// in widget/src/xpwidgts/nsXPLookAndFeel.cpp.
|
||||
typedef enum {
|
||||
eMetric_WindowTitleHeight,
|
||||
eMetric_WindowBorderWidth,
|
||||
eMetric_WindowBorderHeight,
|
||||
eMetric_Widget3DBorder,
|
||||
eMetric_TextFieldBorder, // Native border size
|
||||
eMetric_TextFieldHeight,
|
||||
eMetric_TextVerticalInsidePadding, // needed only because of GTK
|
||||
eMetric_TextShouldUseVerticalInsidePadding, // needed only because of GTK
|
||||
eMetric_TextHorizontalInsideMinimumPadding,
|
||||
eMetric_TextShouldUseHorizontalInsideMinimumPadding, // needed only because of GTK
|
||||
eMetric_ButtonHorizontalInsidePaddingNavQuirks,
|
||||
eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks,
|
||||
eMetric_CheckboxSize,
|
||||
eMetric_RadioboxSize,
|
||||
|
||||
eMetric_ListShouldUseHorizontalInsideMinimumPadding, // needed only because of GTK
|
||||
eMetric_ListHorizontalInsideMinimumPadding,
|
||||
|
||||
eMetric_ListShouldUseVerticalInsidePadding, // needed only because of GTK
|
||||
eMetric_ListVerticalInsidePadding, // needed only because of GTK
|
||||
|
||||
eMetric_CaretBlinkTime, // default, may be overriden by OS
|
||||
eMetric_CaretWidth, // pixel width of caret
|
||||
eMetric_ShowCaretDuringSelection, // show the caret when text is selected?
|
||||
|
@ -210,7 +188,6 @@ public:
|
|||
eMetric_DragThresholdX, // begin a drag if the mouse is moved further than the threshold while the button is down
|
||||
eMetric_DragThresholdY,
|
||||
eMetric_UseAccessibilityTheme, // Accessibility theme being used?
|
||||
eMetric_IsScreenReaderActive, // Screen reader being used?
|
||||
|
||||
eMetric_ScrollArrowStyle, // position of scroll arrows in a scrollbar
|
||||
eMetric_ScrollSliderStyle, // is scroll thumb proportional or fixed?
|
||||
|
@ -352,14 +329,6 @@ public:
|
|||
// When modifying this list, also modify nsXPLookAndFeel::sFloatPrefs
|
||||
// in widget/src/xpwidgts/nsXPLookAndFeel.cpp.
|
||||
typedef enum {
|
||||
eMetricFloat_TextFieldVerticalInsidePadding,
|
||||
eMetricFloat_TextFieldHorizontalInsidePadding,
|
||||
eMetricFloat_TextAreaVerticalInsidePadding,
|
||||
eMetricFloat_TextAreaHorizontalInsidePadding,
|
||||
eMetricFloat_ListVerticalInsidePadding,
|
||||
eMetricFloat_ListHorizontalInsidePadding,
|
||||
eMetricFloat_ButtonVerticalInsidePadding,
|
||||
eMetricFloat_ButtonHorizontalInsidePadding,
|
||||
eMetricFloat_IMEUnderlineRelativeSize,
|
||||
eMetricFloat_SpellCheckerUnderlineRelativeSize,
|
||||
|
||||
|
|
|
@ -330,69 +330,6 @@ nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 &aMetric)
|
|||
rv = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case eMetric_WindowTitleHeight:
|
||||
case eMetric_WindowBorderWidth:
|
||||
case eMetric_WindowBorderHeight:
|
||||
aMetric = 0;
|
||||
break;
|
||||
|
||||
case eMetric_Widget3DBorder:
|
||||
aMetric = 4;
|
||||
break;
|
||||
|
||||
case eMetric_TextFieldHeight:
|
||||
aMetric = 15;
|
||||
break;
|
||||
|
||||
case eMetric_TextFieldBorder:
|
||||
aMetric = 2;
|
||||
break;
|
||||
|
||||
case eMetric_TextVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
|
||||
case eMetric_TextShouldUseVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
|
||||
case eMetric_TextHorizontalInsideMinimumPadding:
|
||||
aMetric = 15;
|
||||
break;
|
||||
|
||||
case eMetric_TextShouldUseHorizontalInsideMinimumPadding:
|
||||
aMetric = 1;
|
||||
break;
|
||||
|
||||
case eMetric_ButtonHorizontalInsidePaddingNavQuirks:
|
||||
aMetric = 10;
|
||||
break;
|
||||
|
||||
case eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks:
|
||||
aMetric = 8;
|
||||
break;
|
||||
|
||||
case eMetric_CheckboxSize:
|
||||
case eMetric_RadioboxSize:
|
||||
aMetric = 15;
|
||||
break;
|
||||
|
||||
case eMetric_ListShouldUseHorizontalInsideMinimumPadding:
|
||||
aMetric = 15;
|
||||
break;
|
||||
|
||||
case eMetric_ListHorizontalInsideMinimumPadding:
|
||||
aMetric = 15;
|
||||
break;
|
||||
|
||||
case eMetric_ListShouldUseVerticalInsidePadding:
|
||||
aMetric = 1;
|
||||
break;
|
||||
|
||||
case eMetric_ListVerticalInsidePadding:
|
||||
aMetric = 1;
|
||||
break;
|
||||
|
||||
case eMetric_CaretBlinkTime:
|
||||
aMetric = 500;
|
||||
break;
|
||||
|
@ -457,38 +394,6 @@ nsLookAndFeel::GetMetric(const nsMetricFloatID aID,
|
|||
rv = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case eMetricFloat_TextFieldVerticalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
|
||||
case eMetricFloat_TextFieldHorizontalInsidePadding:
|
||||
aMetric = 0.95f; // large number on purpose so minimum padding is used
|
||||
break;
|
||||
|
||||
case eMetricFloat_TextAreaVerticalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
|
||||
case eMetricFloat_TextAreaHorizontalInsidePadding:
|
||||
aMetric = 0.40f; // large number on purpose so minimum padding is used
|
||||
break;
|
||||
|
||||
case eMetricFloat_ListVerticalInsidePadding:
|
||||
aMetric = 0.10f;
|
||||
break;
|
||||
|
||||
case eMetricFloat_ListHorizontalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
|
||||
case eMetricFloat_ButtonVerticalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
|
||||
case eMetricFloat_ButtonHorizontalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
|
||||
case eMetricFloat_IMEUnderlineRelativeSize:
|
||||
aMetric = 1.0f;
|
||||
break;
|
||||
|
|
|
@ -309,64 +309,6 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
|||
|
||||
switch (aID)
|
||||
{
|
||||
case eMetric_WindowTitleHeight:
|
||||
// 2*horizontal scrollbar height
|
||||
aMetric = 28;
|
||||
break;
|
||||
case eMetric_WindowBorderWidth:
|
||||
aMetric = 2;
|
||||
break;
|
||||
case eMetric_WindowBorderHeight:
|
||||
aMetric = 2;
|
||||
break;
|
||||
case eMetric_Widget3DBorder:
|
||||
aMetric = 5;
|
||||
break;
|
||||
case eMetric_TextFieldBorder:
|
||||
aMetric = 3;
|
||||
break;
|
||||
case eMetric_TextFieldHeight:
|
||||
aMetric = 24;
|
||||
break;
|
||||
case eMetric_TextVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_TextShouldUseVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_TextHorizontalInsideMinimumPadding:
|
||||
aMetric = 3;
|
||||
break;
|
||||
case eMetric_TextShouldUseHorizontalInsideMinimumPadding:
|
||||
aMetric = 1;
|
||||
break;
|
||||
case eMetric_ButtonHorizontalInsidePaddingNavQuirks:
|
||||
aMetric = 10;
|
||||
break;
|
||||
case eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks:
|
||||
aMetric = 8;
|
||||
break;
|
||||
case eMetric_CheckboxSize:
|
||||
aMetric = 12;
|
||||
break;
|
||||
case eMetric_RadioboxSize:
|
||||
aMetric = 12;
|
||||
break;
|
||||
|
||||
case eMetric_ListShouldUseHorizontalInsideMinimumPadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_ListHorizontalInsideMinimumPadding:
|
||||
aMetric = 3;
|
||||
break;
|
||||
|
||||
case eMetric_ListShouldUseVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_ListVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
|
||||
case eMetric_CaretBlinkTime:
|
||||
aMetric = 500;
|
||||
break;
|
||||
|
@ -462,30 +404,6 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID, float & aMetri
|
|||
res = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case eMetricFloat_TextFieldVerticalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
case eMetricFloat_TextFieldHorizontalInsidePadding:
|
||||
aMetric = 0.95f;
|
||||
break;
|
||||
case eMetricFloat_TextAreaVerticalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
case eMetricFloat_TextAreaHorizontalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
case eMetricFloat_ListVerticalInsidePadding:
|
||||
aMetric = 0.10f;
|
||||
break;
|
||||
case eMetricFloat_ListHorizontalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
case eMetricFloat_ButtonVerticalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
case eMetricFloat_ButtonHorizontalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
case eMetricFloat_IMEUnderlineRelativeSize:
|
||||
aMetric = 1.0f;
|
||||
break;
|
||||
|
|
|
@ -317,60 +317,6 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
|||
res = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case eMetric_WindowTitleHeight:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_WindowBorderWidth:
|
||||
aMetric = 4;
|
||||
break;
|
||||
case eMetric_WindowBorderHeight:
|
||||
aMetric = 4;
|
||||
break;
|
||||
case eMetric_Widget3DBorder:
|
||||
aMetric = 4;
|
||||
break;
|
||||
case eMetric_TextFieldHeight:
|
||||
aMetric = 16;
|
||||
break;
|
||||
case eMetric_TextFieldBorder:
|
||||
aMetric = 2;
|
||||
break;
|
||||
case eMetric_ButtonHorizontalInsidePaddingNavQuirks:
|
||||
aMetric = 20;
|
||||
break;
|
||||
case eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_CheckboxSize:
|
||||
aMetric = 14;
|
||||
break;
|
||||
case eMetric_RadioboxSize:
|
||||
aMetric = 14;
|
||||
break;
|
||||
case eMetric_TextHorizontalInsideMinimumPadding:
|
||||
aMetric = 4;
|
||||
break;
|
||||
case eMetric_TextVerticalInsidePadding:
|
||||
aMetric = 4;
|
||||
break;
|
||||
case eMetric_TextShouldUseVerticalInsidePadding:
|
||||
aMetric = 1;
|
||||
break;
|
||||
case eMetric_TextShouldUseHorizontalInsideMinimumPadding:
|
||||
aMetric = 1;
|
||||
break;
|
||||
case eMetric_ListShouldUseHorizontalInsideMinimumPadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_ListHorizontalInsideMinimumPadding:
|
||||
aMetric = 4;
|
||||
break;
|
||||
case eMetric_ListShouldUseVerticalInsidePadding:
|
||||
aMetric = 1;
|
||||
break;
|
||||
case eMetric_ListVerticalInsidePadding:
|
||||
aMetric = 3;
|
||||
break;
|
||||
case eMetric_CaretBlinkTime:
|
||||
aMetric = 567;
|
||||
break;
|
||||
|
@ -496,30 +442,6 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID, float & aMetri
|
|||
res = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case eMetricFloat_TextFieldVerticalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
case eMetricFloat_TextFieldHorizontalInsidePadding:
|
||||
aMetric = 0.95f;
|
||||
break;
|
||||
case eMetricFloat_TextAreaVerticalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
case eMetricFloat_TextAreaHorizontalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
case eMetricFloat_ListVerticalInsidePadding:
|
||||
aMetric = 0.08f;
|
||||
break;
|
||||
case eMetricFloat_ListHorizontalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
case eMetricFloat_ButtonVerticalInsidePadding:
|
||||
aMetric = 0.5f;
|
||||
break;
|
||||
case eMetricFloat_ButtonHorizontalInsidePadding:
|
||||
aMetric = 0.5f;
|
||||
break;
|
||||
case eMetricFloat_IMEUnderlineRelativeSize:
|
||||
aMetric = 2.0f;
|
||||
break;
|
||||
|
|
|
@ -411,72 +411,6 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
|||
res = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case eMetric_WindowTitleHeight:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_WindowBorderWidth:
|
||||
// XXXldb Why is this commented out?
|
||||
// aMetric = mStyle->klass->xthickness;
|
||||
break;
|
||||
case eMetric_WindowBorderHeight:
|
||||
// XXXldb Why is this commented out?
|
||||
// aMetric = mStyle->klass->ythickness;
|
||||
break;
|
||||
case eMetric_Widget3DBorder:
|
||||
// XXXldb Why is this commented out?
|
||||
// aMetric = 4;
|
||||
break;
|
||||
case eMetric_TextFieldHeight:
|
||||
{
|
||||
GtkRequisition req;
|
||||
GtkWidget *text = gtk_entry_new();
|
||||
// needed to avoid memory leak
|
||||
g_object_ref_sink(GTK_OBJECT(text));
|
||||
gtk_widget_size_request(text,&req);
|
||||
aMetric = req.height;
|
||||
gtk_widget_destroy(text);
|
||||
g_object_unref(text);
|
||||
}
|
||||
break;
|
||||
case eMetric_TextFieldBorder:
|
||||
aMetric = 2;
|
||||
break;
|
||||
case eMetric_TextVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_TextShouldUseVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_TextHorizontalInsideMinimumPadding:
|
||||
aMetric = 15;
|
||||
break;
|
||||
case eMetric_TextShouldUseHorizontalInsideMinimumPadding:
|
||||
aMetric = 1;
|
||||
break;
|
||||
case eMetric_ButtonHorizontalInsidePaddingNavQuirks:
|
||||
aMetric = 10;
|
||||
break;
|
||||
case eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks:
|
||||
aMetric = 8;
|
||||
break;
|
||||
case eMetric_CheckboxSize:
|
||||
aMetric = 15;
|
||||
break;
|
||||
case eMetric_RadioboxSize:
|
||||
aMetric = 15;
|
||||
break;
|
||||
case eMetric_ListShouldUseHorizontalInsideMinimumPadding:
|
||||
aMetric = 15;
|
||||
break;
|
||||
case eMetric_ListHorizontalInsideMinimumPadding:
|
||||
aMetric = 15;
|
||||
break;
|
||||
case eMetric_ListShouldUseVerticalInsidePadding:
|
||||
aMetric = 1;
|
||||
break;
|
||||
case eMetric_ListVerticalInsidePadding:
|
||||
aMetric = 1;
|
||||
break;
|
||||
case eMetric_CaretBlinkTime:
|
||||
{
|
||||
GtkSettings *settings;
|
||||
|
@ -653,30 +587,6 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID,
|
|||
res = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case eMetricFloat_TextFieldVerticalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
case eMetricFloat_TextFieldHorizontalInsidePadding:
|
||||
aMetric = 0.95f; // large number on purpose so minimum padding is used
|
||||
break;
|
||||
case eMetricFloat_TextAreaVerticalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
case eMetricFloat_TextAreaHorizontalInsidePadding:
|
||||
aMetric = 0.40f; // large number on purpose so minimum padding is used
|
||||
break;
|
||||
case eMetricFloat_ListVerticalInsidePadding:
|
||||
aMetric = 0.10f;
|
||||
break;
|
||||
case eMetricFloat_ListHorizontalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
case eMetricFloat_ButtonVerticalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
case eMetricFloat_ButtonHorizontalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
case eMetricFloat_IMEUnderlineRelativeSize:
|
||||
aMetric = 1.0f;
|
||||
break;
|
||||
|
|
|
@ -279,60 +279,6 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
|||
res = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case eMetric_WindowTitleHeight:
|
||||
aMetric = WinQuerySysValue( HWND_DESKTOP, SV_CYTITLEBAR);
|
||||
break;
|
||||
case eMetric_WindowBorderWidth:
|
||||
aMetric = WinQuerySysValue( HWND_DESKTOP, SV_CXSIZEBORDER);
|
||||
break;
|
||||
case eMetric_WindowBorderHeight:
|
||||
aMetric = WinQuerySysValue( HWND_DESKTOP, SV_CYSIZEBORDER);
|
||||
break;
|
||||
case eMetric_Widget3DBorder:
|
||||
aMetric = WinQuerySysValue( HWND_DESKTOP, SV_CXBORDER);
|
||||
break;
|
||||
case eMetric_TextFieldBorder:
|
||||
aMetric = 3;
|
||||
break;
|
||||
case eMetric_TextFieldHeight:
|
||||
aMetric = 24;
|
||||
break;
|
||||
case eMetric_ButtonHorizontalInsidePaddingNavQuirks:
|
||||
aMetric = 10;
|
||||
break;
|
||||
case eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks:
|
||||
aMetric = 8;
|
||||
break;
|
||||
case eMetric_CheckboxSize:
|
||||
aMetric = 12;
|
||||
break;
|
||||
case eMetric_RadioboxSize:
|
||||
aMetric = 12;
|
||||
break;
|
||||
case eMetric_TextHorizontalInsideMinimumPadding:
|
||||
aMetric = 3;
|
||||
break;
|
||||
case eMetric_TextVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_TextShouldUseVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_TextShouldUseHorizontalInsideMinimumPadding:
|
||||
aMetric = 1;
|
||||
break;
|
||||
case eMetric_ListShouldUseHorizontalInsideMinimumPadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_ListHorizontalInsideMinimumPadding:
|
||||
aMetric = 3;
|
||||
break;
|
||||
case eMetric_ListShouldUseVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_ListVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_CaretBlinkTime:
|
||||
aMetric = WinQuerySysValue( HWND_DESKTOP, SV_CURSORRATE);
|
||||
break;
|
||||
|
@ -414,30 +360,6 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID, float & aMetri
|
|||
res = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case eMetricFloat_TextFieldVerticalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
case eMetricFloat_TextFieldHorizontalInsidePadding:
|
||||
aMetric = 1.025f;
|
||||
break;
|
||||
case eMetricFloat_TextAreaVerticalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
case eMetricFloat_TextAreaHorizontalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
case eMetricFloat_ListVerticalInsidePadding:
|
||||
aMetric = 0.10f;
|
||||
break;
|
||||
case eMetricFloat_ListHorizontalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
case eMetricFloat_ButtonVerticalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
case eMetricFloat_ButtonHorizontalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
case eMetricFloat_IMEUnderlineRelativeSize:
|
||||
aMetric = 1.0f;
|
||||
break;
|
||||
|
|
|
@ -305,24 +305,6 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID,nscolor &aColor)
|
|||
|
||||
#ifdef NS_LOOKANDFEEL_DEBUG
|
||||
static const char *metricToString[] = {
|
||||
"eMetric_WindowTitleHeight",
|
||||
"eMetric_WindowBorderWidth",
|
||||
"eMetric_WindowBorderHeight",
|
||||
"eMetric_Widget3DBorder",
|
||||
"eMetric_TextFieldBorder",
|
||||
"eMetric_TextFieldHeight",
|
||||
"eMetric_TextVerticalInsidePadding",
|
||||
"eMetric_TextShouldUseVerticalInsidePadding",
|
||||
"eMetric_TextHorizontalInsideMinimumPadding",
|
||||
"eMetric_TextShouldUseHorizontalInsideMinimumPadding",
|
||||
"eMetric_ButtonHorizontalInsidePaddingNavQuirks",
|
||||
"eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks",
|
||||
"eMetric_CheckboxSize",
|
||||
"eMetric_RadioboxSize",
|
||||
"eMetric_ListShouldUseHorizontalInsideMinimumPadding",
|
||||
"eMetric_ListHorizontalInsideMinimumPadding",
|
||||
"eMetric_ListShouldUseVerticalInsidePadding",
|
||||
"eMetric_ListVerticalInsidePadding",
|
||||
"eMetric_CaretBlinkTime",
|
||||
"eMetric_CaretWidth",
|
||||
"eMetric_ShowCaretDuringSelection",
|
||||
|
@ -333,7 +315,6 @@ static const char *metricToString[] = {
|
|||
"eMetric_DragThresholdX",
|
||||
"eMetric_DragThresholdY",
|
||||
"eMetric_UseAccessibilityTheme",
|
||||
"eMetric_IsScreenReaderActive",
|
||||
"eMetric_ScrollArrowStyle",
|
||||
"eMetric_ScrollSliderStyle",
|
||||
"eMetric_ScrollButtonLeftMouseButtonAction",
|
||||
|
@ -371,78 +352,6 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID,PRInt32 &aMetric)
|
|||
QStyle* qStyle = qApp->style();
|
||||
|
||||
switch (aID) {
|
||||
case eMetric_WindowTitleHeight:
|
||||
aMetric = qStyle->pixelMetric(QStyle::PM_TitleBarHeight);
|
||||
break;
|
||||
|
||||
case eMetric_WindowBorderWidth:
|
||||
// There was once code in nsDeviceContextQt::GetSystemAttribute to
|
||||
// use the border width obtained from a widget in its Init method.
|
||||
break;
|
||||
|
||||
case eMetric_WindowBorderHeight:
|
||||
// There was once code in nsDeviceContextQt::GetSystemAttribute to
|
||||
// use the border width obtained from a widget in its Init method.
|
||||
break;
|
||||
|
||||
case eMetric_Widget3DBorder:
|
||||
aMetric = 4;
|
||||
break;
|
||||
|
||||
case eMetric_TextFieldHeight:
|
||||
aMetric = 15;
|
||||
break;
|
||||
|
||||
case eMetric_TextFieldBorder:
|
||||
aMetric = 2;
|
||||
break;
|
||||
|
||||
case eMetric_TextVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
|
||||
case eMetric_TextShouldUseVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
|
||||
case eMetric_TextHorizontalInsideMinimumPadding:
|
||||
aMetric = 15;
|
||||
break;
|
||||
|
||||
case eMetric_TextShouldUseHorizontalInsideMinimumPadding:
|
||||
aMetric = 1;
|
||||
break;
|
||||
|
||||
case eMetric_ButtonHorizontalInsidePaddingNavQuirks:
|
||||
aMetric = 10;
|
||||
break;
|
||||
|
||||
case eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks:
|
||||
aMetric = 8;
|
||||
break;
|
||||
|
||||
case eMetric_CheckboxSize:
|
||||
case eMetric_RadioboxSize:
|
||||
aMetric = 15;
|
||||
aMetric = qStyle->pixelMetric(QStyle::PM_CheckListButtonSize);
|
||||
break;
|
||||
|
||||
case eMetric_ListShouldUseHorizontalInsideMinimumPadding:
|
||||
aMetric = 15;
|
||||
break;
|
||||
|
||||
case eMetric_ListHorizontalInsideMinimumPadding:
|
||||
aMetric = 15;
|
||||
break;
|
||||
|
||||
case eMetric_ListShouldUseVerticalInsidePadding:
|
||||
aMetric = 1;
|
||||
break;
|
||||
|
||||
case eMetric_ListVerticalInsidePadding:
|
||||
aMetric = 1;
|
||||
break;
|
||||
|
||||
case eMetric_CaretBlinkTime:
|
||||
aMetric = 500;
|
||||
break;
|
||||
|
@ -507,14 +416,6 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID,PRInt32 &aMetric)
|
|||
|
||||
#ifdef NS_LOOKANDFEEL_DEBUG
|
||||
static const char *floatMetricToString[] = {
|
||||
"eMetricFloat_TextFieldVerticalInsidePadding",
|
||||
"eMetricFloat_TextFieldHorizontalInsidePadding",
|
||||
"eMetricFloat_TextAreaVerticalInsidePadding",
|
||||
"eMetricFloat_TextAreaHorizontalInsidePadding",
|
||||
"eMetricFloat_ListVerticalInsidePadding",
|
||||
"eMetricFloat_ListHorizontalInsidePadding",
|
||||
"eMetricFloat_ButtonVerticalInsidePadding",
|
||||
"eMetricFloat_ButtonHorizontalInsidePadding",
|
||||
"eMetricFloat_IMEUnderlineRelativeSize"
|
||||
};
|
||||
#endif
|
||||
|
@ -532,38 +433,6 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID,
|
|||
res = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case eMetricFloat_TextFieldVerticalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
|
||||
case eMetricFloat_TextFieldHorizontalInsidePadding:
|
||||
aMetric = 0.95f; // large number on purpose so minimum padding is used
|
||||
break;
|
||||
|
||||
case eMetricFloat_TextAreaVerticalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
|
||||
case eMetricFloat_TextAreaHorizontalInsidePadding:
|
||||
aMetric = 0.40f; // large number on purpose so minimum padding is used
|
||||
break;
|
||||
|
||||
case eMetricFloat_ListVerticalInsidePadding:
|
||||
aMetric = 0.10f;
|
||||
break;
|
||||
|
||||
case eMetricFloat_ListHorizontalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
|
||||
case eMetricFloat_ButtonVerticalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
|
||||
case eMetricFloat_ButtonHorizontalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
|
||||
case eMetricFloat_IMEUnderlineRelativeSize:
|
||||
aMetric = 1.0f;
|
||||
break;
|
||||
|
|
|
@ -355,62 +355,6 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
|||
res = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case eMetric_WindowTitleHeight:
|
||||
aMetric = ::GetSystemMetrics(SM_CYCAPTION);
|
||||
break;
|
||||
#ifndef WINCE
|
||||
case eMetric_WindowBorderWidth:
|
||||
aMetric = ::GetSystemMetrics(SM_CXFRAME);
|
||||
break;
|
||||
case eMetric_WindowBorderHeight:
|
||||
aMetric = ::GetSystemMetrics(SM_CYFRAME);
|
||||
break;
|
||||
#endif
|
||||
case eMetric_Widget3DBorder:
|
||||
aMetric = ::GetSystemMetrics(SM_CXEDGE);
|
||||
break;
|
||||
case eMetric_TextFieldBorder:
|
||||
aMetric = 3;
|
||||
break;
|
||||
case eMetric_TextFieldHeight:
|
||||
aMetric = 24;
|
||||
break;
|
||||
case eMetric_ButtonHorizontalInsidePaddingNavQuirks:
|
||||
aMetric = 10;
|
||||
break;
|
||||
case eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks:
|
||||
aMetric = 8;
|
||||
break;
|
||||
case eMetric_CheckboxSize:
|
||||
aMetric = 12;
|
||||
break;
|
||||
case eMetric_RadioboxSize:
|
||||
aMetric = 12;
|
||||
break;
|
||||
case eMetric_TextHorizontalInsideMinimumPadding:
|
||||
aMetric = 3;
|
||||
break;
|
||||
case eMetric_TextVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_TextShouldUseVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_TextShouldUseHorizontalInsideMinimumPadding:
|
||||
aMetric = 1;
|
||||
break;
|
||||
case eMetric_ListShouldUseHorizontalInsideMinimumPadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_ListHorizontalInsideMinimumPadding:
|
||||
aMetric = 3;
|
||||
break;
|
||||
case eMetric_ListShouldUseVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_ListVerticalInsidePadding:
|
||||
aMetric = 0;
|
||||
break;
|
||||
case eMetric_CaretBlinkTime:
|
||||
aMetric = (PRInt32)::GetCaretBlinkTime();
|
||||
break;
|
||||
|
@ -459,11 +403,6 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
|||
|
||||
aMetric = ((contrastThemeInfo.dwFlags & HCF_HIGHCONTRASTON) != 0);
|
||||
break;
|
||||
case eMetric_IsScreenReaderActive:
|
||||
// This will default to the Windows' default
|
||||
// (off by default) on error.
|
||||
aMetric = GetSystemParam(SPI_GETSCREENREADER, 0);
|
||||
break;
|
||||
#endif
|
||||
case eMetric_ScrollArrowStyle:
|
||||
aMetric = eMetric_ScrollArrowStyleSingle;
|
||||
|
@ -628,30 +567,6 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID, float & aMetri
|
|||
res = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case eMetricFloat_TextFieldVerticalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
case eMetricFloat_TextFieldHorizontalInsidePadding:
|
||||
aMetric = 1.025f;
|
||||
break;
|
||||
case eMetricFloat_TextAreaVerticalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
case eMetricFloat_TextAreaHorizontalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
case eMetricFloat_ListVerticalInsidePadding:
|
||||
aMetric = 0.10f;
|
||||
break;
|
||||
case eMetricFloat_ListHorizontalInsidePadding:
|
||||
aMetric = 0.40f;
|
||||
break;
|
||||
case eMetricFloat_ButtonVerticalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
case eMetricFloat_ButtonHorizontalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
break;
|
||||
case eMetricFloat_IMEUnderlineRelativeSize:
|
||||
aMetric = 1.0f;
|
||||
break;
|
||||
|
|
|
@ -57,34 +57,6 @@ NS_IMPL_ISUPPORTS2(nsXPLookAndFeel, nsILookAndFeel, nsIObserver)
|
|||
|
||||
nsLookAndFeelIntPref nsXPLookAndFeel::sIntPrefs[] =
|
||||
{
|
||||
{ "ui.windowTitleHeight", eMetric_WindowTitleHeight, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.windowBorderWidth", eMetric_WindowBorderWidth, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.windowBorderHeight", eMetric_WindowBorderHeight, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.widget3DBorder", eMetric_Widget3DBorder, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.textFieldBorder", eMetric_TextFieldBorder, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.textFieldHeight", eMetric_TextFieldHeight, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.buttonHorizontalInsidePaddingNavQuirks",
|
||||
eMetric_ButtonHorizontalInsidePaddingNavQuirks, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.buttonHorizontalInsidePaddingOffsetNavQuirks",
|
||||
eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.checkboxSize", eMetric_CheckboxSize, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.radioboxSize", eMetric_RadioboxSize, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.textHorizontalInsideMinimumPadding",
|
||||
eMetric_TextHorizontalInsideMinimumPadding, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.textVerticalInsidePadding", eMetric_TextVerticalInsidePadding,
|
||||
PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.textShouldUseVerticalInsidePadding",
|
||||
eMetric_TextShouldUseVerticalInsidePadding, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.textShouldUseHorizontalInsideMinimumPadding",
|
||||
eMetric_TextShouldUseHorizontalInsideMinimumPadding, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.listShouldUseHorizontalInsideMinimumPadding",
|
||||
eMetric_ListShouldUseHorizontalInsideMinimumPadding, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.listHorizontalInsideMinimumPadding",
|
||||
eMetric_ListHorizontalInsideMinimumPadding, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.listShouldUseVerticalInsidePadding",
|
||||
eMetric_ListShouldUseVerticalInsidePadding, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.listVerticalInsidePadding", eMetric_ListVerticalInsidePadding,
|
||||
PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.caretBlinkTime", eMetric_CaretBlinkTime, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.caretWidth", eMetric_CaretWidth, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.caretVisibleWithSelection", eMetric_ShowCaretDuringSelection, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
|
@ -92,7 +64,6 @@ nsLookAndFeelIntPref nsXPLookAndFeel::sIntPrefs[] =
|
|||
{ "ui.dragThresholdX", eMetric_DragThresholdX, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.dragThresholdY", eMetric_DragThresholdY, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.useAccessibilityTheme", eMetric_UseAccessibilityTheme, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.isScreenReaderActive", eMetric_IsScreenReaderActive, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.menusCanOverlapOSBar", eMetric_MenusCanOverlapOSBar,
|
||||
PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
{ "ui.skipNavigatingDisabledMenuItem", eMetric_SkipNavigatingDisabledMenuItem, PR_FALSE, nsLookAndFeelTypeInt, 0 },
|
||||
|
@ -126,22 +97,6 @@ nsLookAndFeelIntPref nsXPLookAndFeel::sIntPrefs[] =
|
|||
|
||||
nsLookAndFeelFloatPref nsXPLookAndFeel::sFloatPrefs[] =
|
||||
{
|
||||
{ "ui.textFieldVerticalInsidePadding",
|
||||
eMetricFloat_TextFieldVerticalInsidePadding, PR_FALSE, nsLookAndFeelTypeFloat, 0 },
|
||||
{ "ui.textFieldHorizontalInsidePadding",
|
||||
eMetricFloat_TextFieldHorizontalInsidePadding, PR_FALSE, nsLookAndFeelTypeFloat, 0 },
|
||||
{ "ui.textAreaVerticalInsidePadding", eMetricFloat_TextAreaVerticalInsidePadding,
|
||||
PR_FALSE, nsLookAndFeelTypeFloat, 0 },
|
||||
{ "ui.textAreaHorizontalInsidePadding",
|
||||
eMetricFloat_TextAreaHorizontalInsidePadding, PR_FALSE, nsLookAndFeelTypeFloat, 0 },
|
||||
{ "ui.listVerticalInsidePadding",
|
||||
eMetricFloat_ListVerticalInsidePadding, PR_FALSE, nsLookAndFeelTypeFloat, 0 },
|
||||
{ "ui.listHorizontalInsidePadding",
|
||||
eMetricFloat_ListHorizontalInsidePadding, PR_FALSE, nsLookAndFeelTypeFloat, 0 },
|
||||
{ "ui.buttonVerticalInsidePadding", eMetricFloat_ButtonVerticalInsidePadding,
|
||||
PR_FALSE, nsLookAndFeelTypeFloat, 0 },
|
||||
{ "ui.buttonHorizontalInsidePadding", eMetricFloat_ButtonHorizontalInsidePadding,
|
||||
PR_FALSE, nsLookAndFeelTypeFloat, 0 },
|
||||
{ "ui.IMEUnderlineRelativeSize", eMetricFloat_IMEUnderlineRelativeSize,
|
||||
PR_FALSE, nsLookAndFeelTypeFloat, 0 },
|
||||
{ "ui.SpellCheckerUnderlineRelativeSize",
|
||||
|
|
Загрузка…
Ссылка в новой задаче