Lots more polish!

This commit is contained in:
Marco Cawthorne 2022-09-17 10:34:22 -07:00
parent cbd3105023
commit 6b578a58ce
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
26 changed files with 198 additions and 127 deletions

View File

@ -44,6 +44,16 @@ struct form_control;
id verticalTabsView;
TabLocation currentTabLocation;
UrlSuggestionView *urlSuggestionView;
/* new additions - eukara */
id homeButton;
id bookmarksButton;
id bookmarkAddButton;
id findButton;
id shareButton;
id settingsButton;
id infoButton;
id printButton;
// These three are set based on the currently focused tab.
@ -93,6 +103,15 @@ struct form_control;
-(void)reload: (id)sender;
-(void)stopLoading: (id)sender;
/* new additions - eukara */
-(void)visitHome: (id)sender;
-(void)openBookmarks: (id)sender;
-(void)openFindPanel: (id)sender;
-(void)openPrintPanel: (id)sender;
-(void)openPreferences: (id)sender;
-(void)openInspector: (id)sender;
-(void)sharePage: (id)sender;
-(void)showDropdownMenuWithOptions: (NSArray*)options atLocation: (NSPoint)location inTab: (id)tab control: (struct form_control*)control;

View File

@ -33,7 +33,7 @@
#define TAB_TITLE_LEN 20
// Everything above the browser. Used to calculate the tabview's height.
#define TOP_CONTENT_HEIGHT 45
#define TOP_CONTENT_HEIGHT 86
// Any way to get this programatically?
#define TAB_ITEM_HEIGHT 13
#define VERTICAL_TAB_WIDTH 100
@ -308,10 +308,12 @@ static id newTabTarget;
}
-(void)startThrobber {
[refreshButton setTitle: @"Stop"];
[refreshButton setImage: [NSImage imageNamed: @"Stop.0"]];
[refreshButton setTag: 1];
}
-(void)stopThrobber {
[refreshButton setTitle: @"Refresh"];
[refreshButton setImage: [NSImage imageNamed: @"Fetch"]];
[refreshButton setTag: 0];
}
-(void)setNavigationUrl: (NSString*)urlString forTab: (id)tab {
@ -524,7 +526,7 @@ static id newTabTarget;
if (hideTabs) {
[verticalTabsView removeFromSuperview];
verticalTabsView = nil;
[tabView setTabViewType: NSNoTabsNoBorder];
[tabView setTabViewType: NSNoTabsLineBorder];
[tabView setFrame: rect];
[tabView selectTabViewItem: [activeTab tabItem]];
currentTabLocation = TabLocationNone;
@ -582,13 +584,33 @@ static id newTabTarget;
switch (buttonType) {
case UrlBarButtonTypeImage:
[backButton setTitle: nil];
[backButton setImage: [NSImage imageNamed: @"back"]];
[backButton setImage: [NSImage imageNamed: @"ArrowLeft"]];
[backButton setAlternateImage: [NSImage imageNamed: @"Arrow_Left.Dis"]];
[forwardButton setTitle: nil];
[forwardButton setImage: [NSImage imageNamed: @"forward"]];
[forwardButton setImage: [NSImage imageNamed: @"ArrowRight"]];
[forwardButton setAlternateImage: [NSImage imageNamed: @"Arrow_Right.Dis"]];
[refreshButton setTitle: nil];
[refreshButton setImage: [NSImage imageNamed: @"refresh"]];
[searchImage setImage: [NSImage imageNamed: @"search"]];
[refreshButton setImage: [NSImage imageNamed: @"Fetch"]];
[searchImage setImage: [NSImage imageNamed: @"smallSearch"]];
[searchLabel setStringValue: nil];
/* new additions - eukara */
[homeButton setTitle: nil];
[homeButton setImage: [NSImage imageNamed: @"Home"]];
[bookmarksButton setTitle: nil];
[bookmarksButton setImage: [NSImage imageNamed: @"BookmarksPanel"]];
[bookmarkAddButton setTitle: nil];
[bookmarkAddButton setImage: [NSImage imageNamed: @"AddBookmark"]];
[findButton setTitle: nil];
[findButton setImage: [NSImage imageNamed: @"Librarian"]];
[shareButton setTitle: nil];
[shareButton setImage: [NSImage imageNamed: @"History"]];
[settingsButton setTitle: nil];
[settingsButton setImage: [NSImage imageNamed: @"Processes"]];
[infoButton setTitle: nil];
[infoButton setImage: [NSImage imageNamed: @"Inspector"]];
[printButton setTitle: nil];
[printButton setImage: [NSImage imageNamed: @"Print"]];
break;
case UrlBarButtonTypeText:
[backButton setTitle: @"Back"];
@ -624,4 +646,42 @@ static id newTabTarget;
return newTabTarget;
}
/* new additions */
-(void)visitHome: (id)sender
{
[self openUrlString: [[Preferences defaultPreferences] startupUrl]];
}
-(void)openBookmarks: (id)sender
{
[[[NSApplication sharedApplication] delegate] showBookmarksWindow: sender];
}
-(void)openFindPanel: (id)sender
{
[[[NSApplication sharedApplication] delegate] showFindPanel: sender];
}
-(void)openPrintPanel: (id)sender
{
NSRunAlertPanel(@"Hey!", @"This feature is coming soon.", @"OK", NULL, NULL);
}
-(void)openPreferences: (id)sender
{
[[[NSApplication sharedApplication] delegate] showPreferencesWindow: sender];
}
-(void)openInspector: (id)sender
{
NSRunAlertPanel(@"Hey!", @"This feature is coming soon.", @"OK", NULL, NULL);
}
-(void)sharePage: (id)sender
{
NSRunAlertPanel(@"Hey!", @"This feature is coming soon.", @"OK", NULL, NULL);
}
@end

View File

@ -87,12 +87,14 @@ R_RESOURCES := \
Menu.gorm \
Browser.gorm \
Downloads.gorm \
NetSurf.tiff \
Find.gorm \
History.gorm \
Bookmarks.gorm \
CreateBookmark.gorm \
Preferences.gorm \
Languages.plist \
*.tiff
R_RESOURCES := $(addprefix $(FRONTEND_RESOURCES_DIR)/,$(R_RESOURCES))
@ -104,10 +106,6 @@ E_RESOURCES := \
internal.css \
quirks.css \
SearchEngines \
forward.png \
back.png \
refresh.png \
search.png \
E_RESOURCES := $(addprefix resources/,$(E_RESOURCES))

View File

@ -64,7 +64,7 @@
if (saved != nil) {
return saved;
} else {
return @"https://www.startpage.com";
return @"https://www.vera-visions.com";
}
}
-(void)setStartupUrl: (NSString*)aUrl {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -7,7 +7,15 @@
"navigate:",
"stopOrRefresh:",
"enterUrl:",
"enterSearch:"
"enterSearch:",
"bookmarkPage:",
"openPrintPanel:",
"openBookmarks:",
"openFindPanel:",
"openInspector:",
"openPreferences:",
"sharePage:",
"visitHome:"
);
Outlets = (
backButton,
@ -19,18 +27,34 @@
searchImage,
searchBar,
tabView,
searchLabel
searchLabel,
bookmarkAddButton,
bookmarksButton,
findButton,
homeButton,
infoButton,
printButton,
settingsButton,
shareButton
);
Super = NSWindowController;
};
FirstResponder = {
Actions = (
"back:",
"bookmarkPage:",
"enterSearch:",
"enterUrl:",
"forward:",
"navigate:",
"enterSearch:",
"stopOrRefresh:"
"openPrintPanel:",
"openBookmarks:",
"openFindPanel:",
"openInspector:",
"openPreferences:",
"sharePage:",
"stopOrRefresh:",
"visitHome:"
);
Super = NSObject;
};

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,111 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array/>
<key>CFBundleTypeMIMETypes</key>
<array/>
<key>CFBundleTypeName</key>
<string>HTML</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>public.html</string>
</array>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>NetSurf</string>
<key>CFBundleIdentifier</key>
<string>org.netsurf-browser.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${NETSURF_VERSION}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>org.netsurf-browser.NetSurf.URI</string>
<key>CFBundleURLSchemes</key>
<array>
<string>http</string>
<string>https</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>${NETSURF_SHORT_VERSION}</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NetSurfApp</string>
<key>NSServices</key>
<array/>
<key>UTExportedTypeDeclarations</key>
<array/>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.text</string>
</array>
<key>UTTypeDescription</key>
<string>HTML</string>
<key>UTTypeIdentifier</key>
<string>public.html</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>html</string>
<string>htm</string>
</array>
<key>public.mime-type</key>
<array>
<string>text/html</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.source-code</string>
</array>
<key>UTTypeDescription</key>
<string>CSS</string>
<key>UTTypeIdentifier</key>
<string>org.w3.css</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>css</string>
</array>
<key>public.mime-type</key>
<array>
<string>text/css</string>
</array>
</dict>
</dict>
</array>
</dict>
</plist>
{
ApplicationDescription = "World Wide Web Viewer";
ApplicationIcon = "NetSurf.tiff";
ApplicationName = NetSurf;
ApplicationRelease = "1.0";
Authors = (
"Vera Visions, LLC."
);
CFBundleIdentifier = "com.vera-visions.NetSurf";
CFBundleURLTypes = (
{
CFBundleURLName = "Website URL";
CFBundleURLSchemes = (
http,
https
);
}
);
Copyright = "Copyright \U00A9 2022 Vera Visions, LLC.";
GSMainMarkupFile = "";
NOTE = "Automatically generated, do not edit!";
NSExecutable = NetSurf;
NSIcon = "NetSurf.tiff";
NSMainNibFile = "MainMenu.gorm";
NSMainStoryboardFile = "";
NSPrincipalClass = NSApplication;
NSRole = Application;
NSServices = (
{
NSMenuItem = {
default = "Open URL in NetSurf";
};
NSMessage = openURL;
NSPortName = NetSurf;
NSSendTypes = (
NSURLPboardType,
NSStringPboardType
);
}
);
NSTypes = (
{
NSHumanReadableName = HTML;
NSIcon = "WebDocument.tiff";
NSName = "HTML Document";
NSRole = Editor;
NSUnixExtensions = (
htm,
html
);
},
{
NSHumanReadableName = XHTML;
NSIcon = "WebDocument.tiff";
NSName = "XHTML Document";
NSRole = Viewer;
NSUnixExtensions = (
xhtm,
xhtml
);
}
);
URL = "http://www.vera-visions.com/";
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -221,7 +221,24 @@ NSLayoutManager *cocoa_prepare_layout_manager( const char *bytes, size_t length,
static inline NSFont *cocoa_font_get_nsfont( const plot_font_style_t *style )
{
NSFont *font = [NSFont systemFontOfSize: 12]; /* eukara: font size hack. idc */
NSFont *font;
int fontsize = ((style->size * 1.25) / PLOT_STYLE_SCALE);
/* limit the range between 8 and 12 */
/*if (fontsize <= 8)
fontsize = 8;
else if (fontsize <= 9)
fontsize = 9;
else */if (fontsize <= 10)
fontsize = 10;
else
fontsize = 12;
/* handle code brackets */
if (style->family == PLOT_FONT_FAMILY_MONOSPACE)
font = [NSFont userFixedPitchFontOfSize: fontsize];
else
font = [NSFont systemFontOfSize: fontsize];
NSFontTraitMask traits = 0;
if (style->flags & FONTF_ITALIC || style->flags & FONTF_OBLIQUE) traits |= NSItalicFontMask;