* Moved some settings keys into new files SettingsKeys.h/cpp to make it less
likely to introduce erros with spelling settings keys wrong somewhere. * Introduced new setting for the behavior if tabs should show at all if only one page is showing in a window. Defaults to on, i.e. the previous behavior. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@393 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
committed by
Alexandre Deckner
parent
bb68c7f66d
commit
d5f0e82b84
@@ -167,7 +167,7 @@ BrowserApp::ReadyToRun()
|
|||||||
delete fLaunchRefsMessage;
|
delete fLaunchRefsMessage;
|
||||||
fLaunchRefsMessage = 0;
|
fLaunchRefsMessage = 0;
|
||||||
} else {
|
} else {
|
||||||
BrowserWindow* window = new BrowserWindow(fLastWindowFrame);
|
BrowserWindow* window = new BrowserWindow(fLastWindowFrame, fSettings);
|
||||||
window->Show();
|
window->Show();
|
||||||
}
|
}
|
||||||
PostMessage(PRELOAD_BROWSING_HISTORY);
|
PostMessage(PRELOAD_BROWSING_HISTORY);
|
||||||
@@ -327,7 +327,7 @@ BrowserApp::_CreateNewWindow(const BString& url)
|
|||||||
if (!BScreen().Frame().Contains(fLastWindowFrame))
|
if (!BScreen().Frame().Contains(fLastWindowFrame))
|
||||||
fLastWindowFrame.OffsetTo(50, 50);
|
fLastWindowFrame.OffsetTo(50, 50);
|
||||||
|
|
||||||
BrowserWindow* window = new BrowserWindow(fLastWindowFrame);
|
BrowserWindow* window = new BrowserWindow(fLastWindowFrame, fSettings);
|
||||||
window->Show();
|
window->Show();
|
||||||
if (url.Length())
|
if (url.Length())
|
||||||
window->CurrentWebView()->LoadURL(url.String());
|
window->CurrentWebView()->LoadURL(url.String());
|
||||||
|
|||||||
@@ -38,6 +38,8 @@
|
|||||||
#include "BrowsingHistory.h"
|
#include "BrowsingHistory.h"
|
||||||
#include "IconButton.h"
|
#include "IconButton.h"
|
||||||
#include "NavMenu.h"
|
#include "NavMenu.h"
|
||||||
|
#include "SettingsKeys.h"
|
||||||
|
#include "SettingsMessage.h"
|
||||||
#include "TextControlCompleter.h"
|
#include "TextControlCompleter.h"
|
||||||
#include "WebPage.h"
|
#include "WebPage.h"
|
||||||
#include "WebTabView.h"
|
#include "WebTabView.h"
|
||||||
@@ -257,14 +259,21 @@ private:
|
|||||||
// #pragma mark - BrowserWindow
|
// #pragma mark - BrowserWindow
|
||||||
|
|
||||||
|
|
||||||
BrowserWindow::BrowserWindow(BRect frame, ToolbarPolicy toolbarPolicy,
|
BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* appSettings,
|
||||||
BWebView* webView)
|
ToolbarPolicy toolbarPolicy, BWebView* webView)
|
||||||
:
|
:
|
||||||
BWebWindow(frame, kApplicationName,
|
BWebWindow(frame, kApplicationName,
|
||||||
B_DOCUMENT_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
|
B_DOCUMENT_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
|
||||||
B_AUTO_UPDATE_SIZE_LIMITS | B_ASYNCHRONOUS_CONTROLS),
|
B_AUTO_UPDATE_SIZE_LIMITS | B_ASYNCHRONOUS_CONTROLS),
|
||||||
fZoomTextOnly(true)
|
fAppSettings(appSettings),
|
||||||
|
fZoomTextOnly(true),
|
||||||
|
fShowTabsIfSinglePageOpen(true)
|
||||||
{
|
{
|
||||||
|
fAppSettings->AddListener(BMessenger(this));
|
||||||
|
// fZoomTextOnly = fAppSettings->GetValue("zoom text only", fZoomTextOnly);
|
||||||
|
fShowTabsIfSinglePageOpen = fAppSettings->GetValue(
|
||||||
|
kSettingsKeyShowTabsIfSinglePageOpen, fShowTabsIfSinglePageOpen);
|
||||||
|
|
||||||
BMessage* newTabMessage = new BMessage(NEW_TAB);
|
BMessage* newTabMessage = new BMessage(NEW_TAB);
|
||||||
newTabMessage->AddString("url", "");
|
newTabMessage->AddString("url", "");
|
||||||
newTabMessage->AddPointer("window", this);
|
newTabMessage->AddPointer("window", this);
|
||||||
@@ -461,6 +470,7 @@ BrowserWindow::BrowserWindow(BRect frame, ToolbarPolicy toolbarPolicy,
|
|||||||
|
|
||||||
BrowserWindow::~BrowserWindow()
|
BrowserWindow::~BrowserWindow()
|
||||||
{
|
{
|
||||||
|
fAppSettings->RemoveListener(BMessenger(this));
|
||||||
delete fURLAutoCompleter;
|
delete fURLAutoCompleter;
|
||||||
delete fTabManager;
|
delete fTabManager;
|
||||||
}
|
}
|
||||||
@@ -512,7 +522,8 @@ BrowserWindow::MessageReceived(BMessage* message)
|
|||||||
case RELOAD:
|
case RELOAD:
|
||||||
CurrentWebView()->Reload();
|
CurrentWebView()->Reload();
|
||||||
break;
|
break;
|
||||||
case GOTO_URL: {
|
case GOTO_URL:
|
||||||
|
{
|
||||||
BString url;
|
BString url;
|
||||||
if (message->FindString("url", &url) != B_OK)
|
if (message->FindString("url", &url) != B_OK)
|
||||||
url = fURLTextControl->Text();
|
url = fURLTextControl->Text();
|
||||||
@@ -548,7 +559,8 @@ BrowserWindow::MessageReceived(BMessage* message)
|
|||||||
_ShowBookmarks();
|
_ShowBookmarks();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case B_REFS_RECEIVED: {
|
case B_REFS_RECEIVED:
|
||||||
|
{
|
||||||
// Currently the only source of these messages is the bookmarks menu.
|
// Currently the only source of these messages is the bookmarks menu.
|
||||||
// Filter refs into URLs, this also gets rid of refs for folders.
|
// Filter refs into URLs, this also gets rid of refs for folders.
|
||||||
// For clicks on sub-folders in the bookmarks menu, we have Tracker
|
// For clicks on sub-folders in the bookmarks menu, we have Tracker
|
||||||
@@ -556,16 +568,14 @@ BrowserWindow::MessageReceived(BMessage* message)
|
|||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
uint32 addedCount = 0;
|
uint32 addedCount = 0;
|
||||||
for (int32 i = 0; message->FindRef("refs", i, &ref) == B_OK; i++) {
|
for (int32 i = 0; message->FindRef("refs", i, &ref) == B_OK; i++) {
|
||||||
printf("B_REFS_RECEIVED: %s\n", ref.name);
|
|
||||||
BEntry entry(&ref);
|
BEntry entry(&ref);
|
||||||
uint32 addedSubCount = 0;
|
uint32 addedSubCount = 0;
|
||||||
if (entry.IsDirectory()) {
|
if (entry.IsDirectory()) {
|
||||||
BDirectory directory(&entry);
|
BDirectory directory(&entry);
|
||||||
printf(" directory ok\n");
|
_AddBookmarkURLsRecursively(directory, message,
|
||||||
_AddBookmarkURLsRecursively(directory, message, addedSubCount);
|
addedSubCount);
|
||||||
} else {
|
} else {
|
||||||
BFile file(&ref, B_READ_ONLY);
|
BFile file(&ref, B_READ_ONLY);
|
||||||
printf(" file ok\n");
|
|
||||||
BString url;
|
BString url;
|
||||||
if (_ReadURLAttr(file, url)) {
|
if (_ReadURLAttr(file, url)) {
|
||||||
message->AddString("url", url.String());
|
message->AddString("url", url.String());
|
||||||
@@ -594,10 +604,12 @@ printf(" file ok\n");
|
|||||||
be_app->PostMessage(message);
|
be_app->PostMessage(message);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case B_SIMPLE_DATA: {
|
case B_SIMPLE_DATA:
|
||||||
|
{
|
||||||
// User possibly dropped files on this window.
|
// User possibly dropped files on this window.
|
||||||
// If there is more than one entry_ref, let the app handle it (open one
|
// If there is more than one entry_ref, let the app handle it
|
||||||
// new page per ref). If there is one ref, open it in this window.
|
// (open one new page per ref). If there is one ref, open it in
|
||||||
|
// this window.
|
||||||
type_code type;
|
type_code type;
|
||||||
int32 countFound;
|
int32 countFound;
|
||||||
if (message->GetInfo("refs", &type, &countFound) != B_OK
|
if (message->GetInfo("refs", &type, &countFound) != B_OK
|
||||||
@@ -632,8 +644,8 @@ printf(" file ok\n");
|
|||||||
case ZOOM_TEXT_ONLY:
|
case ZOOM_TEXT_ONLY:
|
||||||
fZoomTextOnly = !fZoomTextOnly;
|
fZoomTextOnly = !fZoomTextOnly;
|
||||||
fZoomTextOnlyMenuItem->SetMarked(fZoomTextOnly);
|
fZoomTextOnlyMenuItem->SetMarked(fZoomTextOnly);
|
||||||
// TODO: Would be nice to have an instant update if the page is already
|
// TODO: Would be nice to have an instant update if the page is
|
||||||
// zoomed.
|
// already zoomed.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TEXT_FIND_NEXT:
|
case TEXT_FIND_NEXT:
|
||||||
@@ -671,7 +683,8 @@ printf(" file ok\n");
|
|||||||
PostMessage(B_QUIT_REQUESTED);
|
PostMessage(B_QUIT_REQUESTED);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SELECT_TAB: {
|
case SELECT_TAB:
|
||||||
|
{
|
||||||
int32 index;
|
int32 index;
|
||||||
if (message->FindInt32("tab index", &index) == B_OK
|
if (message->FindInt32("tab index", &index) == B_OK
|
||||||
&& fTabManager->SelectedTabIndex() != index
|
&& fTabManager->SelectedTabIndex() != index
|
||||||
@@ -682,8 +695,10 @@ printf(" file ok\n");
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case TAB_CHANGED: {
|
case TAB_CHANGED:
|
||||||
// This message may be received also when the last tab closed, i.e. with index == -1.
|
{
|
||||||
|
// This message may be received also when the last tab closed,
|
||||||
|
// i.e. with index == -1.
|
||||||
int32 index;
|
int32 index;
|
||||||
if (message->FindInt32("tab index", &index) != B_OK)
|
if (message->FindInt32("tab index", &index) != B_OK)
|
||||||
index = -1;
|
index = -1;
|
||||||
@@ -691,6 +706,22 @@ printf(" file ok\n");
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case SETTINGS_VALUE_CHANGED:
|
||||||
|
{
|
||||||
|
BString name;
|
||||||
|
if (message->FindString("name", &name) != B_OK)
|
||||||
|
break;
|
||||||
|
bool flag;
|
||||||
|
if (name == kSettingsKeyShowTabsIfSinglePageOpen
|
||||||
|
&& message->FindBool("value", &flag) == B_OK) {
|
||||||
|
if (fShowTabsIfSinglePageOpen != flag) {
|
||||||
|
fShowTabsIfSinglePageOpen = flag;
|
||||||
|
_UpdateTabGroupVisibility();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BWebWindow::MessageReceived(message);
|
BWebWindow::MessageReceived(message);
|
||||||
break;
|
break;
|
||||||
@@ -898,7 +929,7 @@ BrowserWindow::NewPageCreated(BWebView* view, BRect windowFrame,
|
|||||||
bool modalDialog, bool resizable)
|
bool modalDialog, bool resizable)
|
||||||
{
|
{
|
||||||
if (windowFrame.IsValid()) {
|
if (windowFrame.IsValid()) {
|
||||||
BrowserWindow* window = new BrowserWindow(windowFrame,
|
BrowserWindow* window = new BrowserWindow(windowFrame, fAppSettings,
|
||||||
DoNotHaveToolbar, view);
|
DoNotHaveToolbar, view);
|
||||||
window->Show();
|
window->Show();
|
||||||
} else
|
} else
|
||||||
@@ -1166,7 +1197,8 @@ void
|
|||||||
BrowserWindow::_UpdateTabGroupVisibility()
|
BrowserWindow::_UpdateTabGroupVisibility()
|
||||||
{
|
{
|
||||||
if (Lock()) {
|
if (Lock()) {
|
||||||
// fTabGroup->SetVisible(fTabManager->CountTabs() > 1);
|
fTabGroup->SetVisible(fShowTabsIfSinglePageOpen
|
||||||
|
|| fTabManager->CountTabs() > 1);
|
||||||
fTabManager->SetCloseButtonsAvailable(fTabManager->CountTabs() > 1);
|
fTabManager->SetCloseButtonsAvailable(fTabManager->CountTabs() > 1);
|
||||||
Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,11 @@ class BPath;
|
|||||||
class BStatusBar;
|
class BStatusBar;
|
||||||
class BStringView;
|
class BStringView;
|
||||||
class BTextControl;
|
class BTextControl;
|
||||||
|
class BWebView;
|
||||||
class IconButton;
|
class IconButton;
|
||||||
|
class SettingsMessage;
|
||||||
class TabManager;
|
class TabManager;
|
||||||
class TextControlCompleter;
|
class TextControlCompleter;
|
||||||
class BWebView;
|
|
||||||
|
|
||||||
enum ToolbarPolicy {
|
enum ToolbarPolicy {
|
||||||
HaveToolbar,
|
HaveToolbar,
|
||||||
@@ -70,6 +71,7 @@ enum {
|
|||||||
class BrowserWindow : public BWebWindow {
|
class BrowserWindow : public BWebWindow {
|
||||||
public:
|
public:
|
||||||
BrowserWindow(BRect frame,
|
BrowserWindow(BRect frame,
|
||||||
|
SettingsMessage* appSettings,
|
||||||
ToolbarPolicy = HaveToolbar,
|
ToolbarPolicy = HaveToolbar,
|
||||||
BWebView* webView = NULL);
|
BWebView* webView = NULL);
|
||||||
virtual ~BrowserWindow();
|
virtual ~BrowserWindow();
|
||||||
@@ -144,7 +146,6 @@ private:
|
|||||||
private:
|
private:
|
||||||
BMenu* fGoMenu;
|
BMenu* fGoMenu;
|
||||||
BMenuItem* fZoomTextOnlyMenuItem;
|
BMenuItem* fZoomTextOnlyMenuItem;
|
||||||
bool fZoomTextOnly;
|
|
||||||
IconButton* fBackButton;
|
IconButton* fBackButton;
|
||||||
IconButton* fForwardButton;
|
IconButton* fForwardButton;
|
||||||
IconButton* fStopButton;
|
IconButton* fStopButton;
|
||||||
@@ -163,6 +164,10 @@ private:
|
|||||||
BTextControl* fFindTextControl;
|
BTextControl* fFindTextControl;
|
||||||
BCheckBox* fFindCaseSensitiveCheckBox;
|
BCheckBox* fFindCaseSensitiveCheckBox;
|
||||||
TabManager* fTabManager;
|
TabManager* fTabManager;
|
||||||
|
|
||||||
|
SettingsMessage* fAppSettings;
|
||||||
|
bool fZoomTextOnly;
|
||||||
|
bool fShowTabsIfSinglePageOpen;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010 Stephan Aßmus <[email protected]>
|
||||||
|
*
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
|
||||||
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||||
|
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "SettingsKeys.h"
|
||||||
|
|
||||||
|
const char* kSettingsKeyDownloadPath = "download path";
|
||||||
|
const char* kSettingsKeyShowTabsIfSinglePageOpen
|
||||||
|
= "show tabs if single page open";
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010 Stephan Aßmus <[email protected]>
|
||||||
|
*
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
|
||||||
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||||
|
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
#ifndef SETTINGS_KEYS_H
|
||||||
|
#define SETTINGS_KEYS_H
|
||||||
|
|
||||||
|
#include <SupportDefs.h>
|
||||||
|
|
||||||
|
|
||||||
|
extern const char* kSettingsKeyDownloadPath;
|
||||||
|
extern const char* kSettingsKeyShowTabsIfSinglePageOpen;
|
||||||
|
|
||||||
|
|
||||||
|
#endif // SETTINGS_KEYS_H
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
#include "SettingsWindow.h"
|
#include "SettingsWindow.h"
|
||||||
|
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
#include <CheckBox.h>
|
||||||
#include <ControlLook.h>
|
#include <ControlLook.h>
|
||||||
#include <GridLayoutBuilder.h>
|
#include <GridLayoutBuilder.h>
|
||||||
#include <GroupLayout.h>
|
#include <GroupLayout.h>
|
||||||
@@ -48,6 +49,7 @@
|
|||||||
#include "BrowserApp.h"
|
#include "BrowserApp.h"
|
||||||
#include "BrowsingHistory.h"
|
#include "BrowsingHistory.h"
|
||||||
#include "FontSelectionView.h"
|
#include "FontSelectionView.h"
|
||||||
|
#include "SettingsKeys.h"
|
||||||
#include "SettingsMessage.h"
|
#include "SettingsMessage.h"
|
||||||
#include "WebSettings.h"
|
#include "WebSettings.h"
|
||||||
|
|
||||||
@@ -64,6 +66,7 @@ enum {
|
|||||||
MSG_DOWNLOAD_FOLDER_CHANGED = 'dnfc',
|
MSG_DOWNLOAD_FOLDER_CHANGED = 'dnfc',
|
||||||
MSG_NEW_PAGE_BEHAVIOR_CHANGED = 'npbc',
|
MSG_NEW_PAGE_BEHAVIOR_CHANGED = 'npbc',
|
||||||
MSG_GO_MENU_DAYS_CHANGED = 'digm',
|
MSG_GO_MENU_DAYS_CHANGED = 'digm',
|
||||||
|
MSG_TAB_DISPLAY_BEHAVIOR_CHANGED = 'tdbc',
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int32 kDefaultFontSize = 14;
|
static const int32 kDefaultFontSize = 14;
|
||||||
@@ -155,19 +158,25 @@ SettingsWindow::MessageReceived(BMessage* message)
|
|||||||
_RevertSettings();
|
_RevertSettings();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSG_STANDARD_FONT_SIZE_SELECTED: {
|
case MSG_STANDARD_FONT_SIZE_SELECTED:
|
||||||
|
{
|
||||||
int32 size = _SizesMenuValue(fStandardSizesMenu->Menu());
|
int32 size = _SizesMenuValue(fStandardSizesMenu->Menu());
|
||||||
fStandardFontView->SetSize(size);
|
fStandardFontView->SetSize(size);
|
||||||
fSerifFontView->SetSize(size);
|
fSerifFontView->SetSize(size);
|
||||||
fSansSerifFontView->SetSize(size);
|
fSansSerifFontView->SetSize(size);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MSG_FIXED_FONT_SIZE_SELECTED: {
|
case MSG_FIXED_FONT_SIZE_SELECTED:
|
||||||
|
{
|
||||||
int32 size = _SizesMenuValue(fFixedSizesMenu->Menu());
|
int32 size = _SizesMenuValue(fFixedSizesMenu->Menu());
|
||||||
fFixedFontView->SetSize(size);
|
fFixedFontView->SetSize(size);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case MSG_TAB_DISPLAY_BEHAVIOR_CHANGED:
|
||||||
|
// TODO: Some settings could change live, some others not?
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BWindow::MessageReceived(message);
|
BWindow::MessageReceived(message);
|
||||||
break;
|
break;
|
||||||
@@ -236,6 +245,11 @@ fNewPageBehaviorMenu->SetEnabled(false);
|
|||||||
for (uchar i = '9' + 1; i <= 128; i++)
|
for (uchar i = '9' + 1; i <= 128; i++)
|
||||||
fDaysInGoMenuControl->TextView()->DisallowChar(i);
|
fDaysInGoMenuControl->TextView()->DisallowChar(i);
|
||||||
|
|
||||||
|
fShowTabsIfOnlyOnePage = new BCheckBox("show tabs if only one page",
|
||||||
|
TR("Show tabs if only page is open."),
|
||||||
|
new BMessage(MSG_TAB_DISPLAY_BEHAVIOR_CHANGED));
|
||||||
|
fShowTabsIfOnlyOnePage->SetValue(B_CONTROL_ON);
|
||||||
|
|
||||||
BView* view = BGridLayoutBuilder(spacing / 2, spacing / 2)
|
BView* view = BGridLayoutBuilder(spacing / 2, spacing / 2)
|
||||||
.Add(fDownloadFolderControl->CreateLabelLayoutItem(), 0, 1)
|
.Add(fDownloadFolderControl->CreateLabelLayoutItem(), 0, 1)
|
||||||
.Add(fDownloadFolderControl->CreateTextViewLayoutItem(), 1, 1)
|
.Add(fDownloadFolderControl->CreateTextViewLayoutItem(), 1, 1)
|
||||||
@@ -246,7 +260,9 @@ fNewPageBehaviorMenu->SetEnabled(false);
|
|||||||
.Add(fDaysInGoMenuControl->CreateLabelLayoutItem(), 0, 3)
|
.Add(fDaysInGoMenuControl->CreateLabelLayoutItem(), 0, 3)
|
||||||
.Add(fDaysInGoMenuControl->CreateTextViewLayoutItem(), 1, 3)
|
.Add(fDaysInGoMenuControl->CreateTextViewLayoutItem(), 1, 3)
|
||||||
|
|
||||||
.Add(BSpaceLayoutItem::CreateHorizontalStrut(spacing), 0, 4, 2)
|
.Add(fShowTabsIfOnlyOnePage, 0, 4, 2)
|
||||||
|
|
||||||
|
.Add(BSpaceLayoutItem::CreateHorizontalStrut(spacing), 0, 5, 2)
|
||||||
|
|
||||||
.SetInsets(spacing, spacing, spacing, spacing)
|
.SetInsets(spacing, spacing, spacing, spacing)
|
||||||
;
|
;
|
||||||
@@ -323,7 +339,9 @@ SettingsWindow::_ApplySettings()
|
|||||||
fDaysInGoMenuControl->SetText(text.String());
|
fDaysInGoMenuControl->SetText(text.String());
|
||||||
BrowsingHistory::DefaultInstance()->SetMaxHistoryItemAge(maxHistoryAge);
|
BrowsingHistory::DefaultInstance()->SetMaxHistoryItemAge(maxHistoryAge);
|
||||||
|
|
||||||
fSettings->SetValue("download path", fDownloadFolderControl->Text());
|
fSettings->SetValue(kSettingsKeyDownloadPath, fDownloadFolderControl->Text());
|
||||||
|
fSettings->SetValue(kSettingsKeyShowTabsIfSinglePageOpen,
|
||||||
|
fShowTabsIfOnlyOnePage->Value() == B_CONTROL_ON);
|
||||||
|
|
||||||
// Store fond settings
|
// Store fond settings
|
||||||
fSettings->SetValue("standard font", fStandardFontView->Font());
|
fSettings->SetValue("standard font", fStandardFontView->Font());
|
||||||
@@ -354,6 +372,11 @@ SettingsWindow::_ApplySettings()
|
|||||||
void
|
void
|
||||||
SettingsWindow::_RevertSettings()
|
SettingsWindow::_RevertSettings()
|
||||||
{
|
{
|
||||||
|
fDownloadFolderControl->SetText(
|
||||||
|
fSettings->GetValue(kSettingsKeyDownloadPath, ""));
|
||||||
|
fShowTabsIfOnlyOnePage->SetValue(
|
||||||
|
fSettings->GetValue(kSettingsKeyShowTabsIfSinglePageOpen, true));
|
||||||
|
|
||||||
int32 defaultFontSize = fSettings->GetValue("standard font size",
|
int32 defaultFontSize = fSettings->GetValue("standard font size",
|
||||||
kDefaultFontSize);
|
kDefaultFontSize);
|
||||||
int32 defaultFixedFontSize = fSettings->GetValue("fixed font size",
|
int32 defaultFixedFontSize = fSettings->GetValue("fixed font size",
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
class BButton;
|
class BButton;
|
||||||
|
class BCheckBox;
|
||||||
class BMenu;
|
class BMenu;
|
||||||
class BMenuField;
|
class BMenuField;
|
||||||
class BMenuItem;
|
class BMenuItem;
|
||||||
@@ -73,6 +74,7 @@ private:
|
|||||||
BMenuItem* fNewPageBehaviorOpenSearchItem;
|
BMenuItem* fNewPageBehaviorOpenSearchItem;
|
||||||
BMenuItem* fNewPageBehaviorOpenBlankItem;
|
BMenuItem* fNewPageBehaviorOpenBlankItem;
|
||||||
BTextControl* fDaysInGoMenuControl;
|
BTextControl* fDaysInGoMenuControl;
|
||||||
|
BCheckBox* fShowTabsIfOnlyOnePage;
|
||||||
|
|
||||||
FontSelectionView* fStandardFontView;
|
FontSelectionView* fStandardFontView;
|
||||||
FontSelectionView* fSerifFontView;
|
FontSelectionView* fSerifFontView;
|
||||||
|
|||||||
Reference in New Issue
Block a user