From 341d327dbe7e79cb0d36ed56ed2dbc47ea00501e Mon Sep 17 00:00:00 2001 From: "bryner%netscape.com" Date: Sat, 20 Aug 2005 07:12:24 +0000 Subject: [PATCH] Prefer do_GetAtom to dont_AddRef(NS_NewAtom(...)). Also, tweak the borders on checkbox/radio buttons and containers a bit. Not part of the build. --- widget/src/gtk/nsNativeThemeGTK.cpp | 21 ++++++++++----------- widget/src/gtk2/nsNativeThemeGTK.cpp | 21 ++++++++++----------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/widget/src/gtk/nsNativeThemeGTK.cpp b/widget/src/gtk/nsNativeThemeGTK.cpp index 034a74c37e23..8986a359d03c 100644 --- a/widget/src/gtk/nsNativeThemeGTK.cpp +++ b/widget/src/gtk/nsNativeThemeGTK.cpp @@ -70,12 +70,12 @@ nsNativeThemeGTK::nsNativeThemeGTK() mProtoLayout(nsnull) { NS_INIT_ISUPPORTS(); - mDisabledAtom = getter_AddRefs(NS_NewAtom("disabled")); - mCheckedAtom = getter_AddRefs(NS_NewAtom("checked")); - mSelectedAtom = getter_AddRefs(NS_NewAtom("selected")); - mInputCheckedAtom = getter_AddRefs(NS_NewAtom("_moz-input-checked")); - mInputAtom = getter_AddRefs(NS_NewAtom("input")); - mFocusedAtom = getter_AddRefs(NS_NewAtom("focused")); + mDisabledAtom = do_GetAtom("disabled"); + mCheckedAtom = do_GetAtom("checked"); + mSelectedAtom = do_GetAtom("selected"); + mInputCheckedAtom = do_GetAtom("_moz-input-checked"); + mInputAtom = do_GetAtom("input"); + mFocusedAtom = do_GetAtom("focused"); } nsNativeThemeGTK::~nsNativeThemeGTK() { @@ -358,11 +358,6 @@ nsNativeThemeGTK::GetWidgetBorder(nsIDeviceContext* aContext, nsIFrame* aFrame, EnsureButtonWidget(); WidgetBorderToMargin(gButtonWidget, aResult); break; - case NS_THEME_CHECKBOX: - case NS_THEME_RADIO: - EnsureCheckBoxWidget(); - WidgetBorderToMargin(gCheckboxWidget, aResult); - break; case NS_THEME_TOOLBAR_GRIPPER: EnsureGripperWidget(); WidgetBorderToMargin(gGripperWidget, aResult); @@ -371,6 +366,10 @@ nsNativeThemeGTK::GetWidgetBorder(nsIDeviceContext* aContext, nsIFrame* aFrame, EnsureArrowWidget(); WidgetBorderToMargin(gDropdownButtonWidget, aResult); break; + case NS_THEME_CHECKBOX_CONTAINER: + case NS_THEME_RADIO_CONTAINER: + aResult->top = aResult->bottom = aResult->left = aResult->right = 1; + break; } return NS_OK; diff --git a/widget/src/gtk2/nsNativeThemeGTK.cpp b/widget/src/gtk2/nsNativeThemeGTK.cpp index 034a74c37e23..8986a359d03c 100644 --- a/widget/src/gtk2/nsNativeThemeGTK.cpp +++ b/widget/src/gtk2/nsNativeThemeGTK.cpp @@ -70,12 +70,12 @@ nsNativeThemeGTK::nsNativeThemeGTK() mProtoLayout(nsnull) { NS_INIT_ISUPPORTS(); - mDisabledAtom = getter_AddRefs(NS_NewAtom("disabled")); - mCheckedAtom = getter_AddRefs(NS_NewAtom("checked")); - mSelectedAtom = getter_AddRefs(NS_NewAtom("selected")); - mInputCheckedAtom = getter_AddRefs(NS_NewAtom("_moz-input-checked")); - mInputAtom = getter_AddRefs(NS_NewAtom("input")); - mFocusedAtom = getter_AddRefs(NS_NewAtom("focused")); + mDisabledAtom = do_GetAtom("disabled"); + mCheckedAtom = do_GetAtom("checked"); + mSelectedAtom = do_GetAtom("selected"); + mInputCheckedAtom = do_GetAtom("_moz-input-checked"); + mInputAtom = do_GetAtom("input"); + mFocusedAtom = do_GetAtom("focused"); } nsNativeThemeGTK::~nsNativeThemeGTK() { @@ -358,11 +358,6 @@ nsNativeThemeGTK::GetWidgetBorder(nsIDeviceContext* aContext, nsIFrame* aFrame, EnsureButtonWidget(); WidgetBorderToMargin(gButtonWidget, aResult); break; - case NS_THEME_CHECKBOX: - case NS_THEME_RADIO: - EnsureCheckBoxWidget(); - WidgetBorderToMargin(gCheckboxWidget, aResult); - break; case NS_THEME_TOOLBAR_GRIPPER: EnsureGripperWidget(); WidgetBorderToMargin(gGripperWidget, aResult); @@ -371,6 +366,10 @@ nsNativeThemeGTK::GetWidgetBorder(nsIDeviceContext* aContext, nsIFrame* aFrame, EnsureArrowWidget(); WidgetBorderToMargin(gDropdownButtonWidget, aResult); break; + case NS_THEME_CHECKBOX_CONTAINER: + case NS_THEME_RADIO_CONTAINER: + aResult->top = aResult->bottom = aResult->left = aResult->right = 1; + break; } return NS_OK;