Add support for smooth text toggling.

This commit is contained in:
hyatt%netscape.com 2002-04-25 08:50:02 +00:00
Родитель c9141d85fe
Коммит 5c88264a39
4 изменённых файлов: 76 добавлений и 8 удалений

Просмотреть файл

@ -42,6 +42,7 @@
#include "nsIServiceManager.h"
#include "nsIIOService.h"
#include "nsCocoaBrowserService.h"
#include "nsIPrefBranch.h"
#import "CHAboutBox.h"
@ -367,8 +368,24 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
- (IBAction)toggleSmoothText:(id)aSender
{
// XXXdwh Grab the prefs service and just set the pref directly.
// Grab the prefs service and just set the pref directly.
nsCOMPtr<nsIPrefBranch> pref(do_GetService("@mozilla.org/preferences-service;1"));
if (!pref)
return; // Something bad happened if we can't get prefs.
int mode;
pref->GetIntPref("nglayout.mac.renderingmode", &mode);
if (mode == 0) {
// Turn on ATSUI Quartz.
pref->SetIntPref("nglayout.mac.renderingmode", 1);
// Check the menu.
[aSender setState: NSOnState];
} else {
// Turn off ATSUI Quartz and use Quickdraw.
pref->SetIntPref("nglayout.mac.renderingmode", 0);
// Uncheck the menu.
[aSender setState: NSOffState];
}
}

Просмотреть файл

@ -42,6 +42,7 @@
#include "nsIServiceManager.h"
#include "nsIIOService.h"
#include "nsCocoaBrowserService.h"
#include "nsIPrefBranch.h"
#import "CHAboutBox.h"
@ -367,8 +368,24 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
- (IBAction)toggleSmoothText:(id)aSender
{
// XXXdwh Grab the prefs service and just set the pref directly.
// Grab the prefs service and just set the pref directly.
nsCOMPtr<nsIPrefBranch> pref(do_GetService("@mozilla.org/preferences-service;1"));
if (!pref)
return; // Something bad happened if we can't get prefs.
int mode;
pref->GetIntPref("nglayout.mac.renderingmode", &mode);
if (mode == 0) {
// Turn on ATSUI Quartz.
pref->SetIntPref("nglayout.mac.renderingmode", 1);
// Check the menu.
[aSender setState: NSOnState];
} else {
// Turn off ATSUI Quartz and use Quickdraw.
pref->SetIntPref("nglayout.mac.renderingmode", 0);
// Uncheck the menu.
[aSender setState: NSOffState];
}
}

Просмотреть файл

@ -42,6 +42,7 @@
#include "nsIServiceManager.h"
#include "nsIIOService.h"
#include "nsCocoaBrowserService.h"
#include "nsIPrefBranch.h"
#import "CHAboutBox.h"
@ -367,8 +368,24 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
- (IBAction)toggleSmoothText:(id)aSender
{
// XXXdwh Grab the prefs service and just set the pref directly.
// Grab the prefs service and just set the pref directly.
nsCOMPtr<nsIPrefBranch> pref(do_GetService("@mozilla.org/preferences-service;1"));
if (!pref)
return; // Something bad happened if we can't get prefs.
int mode;
pref->GetIntPref("nglayout.mac.renderingmode", &mode);
if (mode == 0) {
// Turn on ATSUI Quartz.
pref->SetIntPref("nglayout.mac.renderingmode", 1);
// Check the menu.
[aSender setState: NSOnState];
} else {
// Turn off ATSUI Quartz and use Quickdraw.
pref->SetIntPref("nglayout.mac.renderingmode", 0);
// Uncheck the menu.
[aSender setState: NSOffState];
}
}

Просмотреть файл

@ -42,6 +42,7 @@
#include "nsIServiceManager.h"
#include "nsIIOService.h"
#include "nsCocoaBrowserService.h"
#include "nsIPrefBranch.h"
#import "CHAboutBox.h"
@ -367,8 +368,24 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
- (IBAction)toggleSmoothText:(id)aSender
{
// XXXdwh Grab the prefs service and just set the pref directly.
// Grab the prefs service and just set the pref directly.
nsCOMPtr<nsIPrefBranch> pref(do_GetService("@mozilla.org/preferences-service;1"));
if (!pref)
return; // Something bad happened if we can't get prefs.
int mode;
pref->GetIntPref("nglayout.mac.renderingmode", &mode);
if (mode == 0) {
// Turn on ATSUI Quartz.
pref->SetIntPref("nglayout.mac.renderingmode", 1);
// Check the menu.
[aSender setState: NSOnState];
} else {
// Turn off ATSUI Quartz and use Quickdraw.
pref->SetIntPref("nglayout.mac.renderingmode", 0);
// Uncheck the menu.
[aSender setState: NSOffState];
}
}