From 256cb0958ee03a8cd6d256b8aa39a4972e608129 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 19 Dec 2020 19:40:16 -0500 Subject: [PATCH] Fix scroll bar not appearing in dark mode --- Gemini-iOS/BrowserWebViewController.swift | 2 ++ Gemini-iOS/NavigationBarView.swift | 20 ++++++++++++++++++++ Gemini-iOS/Resources/browser.css | 9 ++++----- 3 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 Gemini-iOS/NavigationBarView.swift diff --git a/Gemini-iOS/BrowserWebViewController.swift b/Gemini-iOS/BrowserWebViewController.swift index c4bcfae..7b27664 100644 --- a/Gemini-iOS/BrowserWebViewController.swift +++ b/Gemini-iOS/BrowserWebViewController.swift @@ -76,6 +76,8 @@ class BrowserWebViewController: UIViewController { webView.navigationDelegate = self // it is safe to set the delegate of the web view's internal scroll view becuase WebKit takes care of forwarding between its internal delegate and our own webView.scrollView.delegate = scrollViewDelegate + // this doesn't default to .default :S + webView.scrollView.indicatorStyle = .default webView.translatesAutoresizingMaskIntoConstraints = false view.addSubview(webView) NSLayoutConstraint.activate([ diff --git a/Gemini-iOS/NavigationBarView.swift b/Gemini-iOS/NavigationBarView.swift new file mode 100644 index 0000000..9b6bd8b --- /dev/null +++ b/Gemini-iOS/NavigationBarView.swift @@ -0,0 +1,20 @@ +// +// NavigationBarView.swift +// Gemini-iOS +// +// Created by Shadowfacts on 12/19/20. +// + +import UIKit + +class NavigationBarView: UIView { + + /* + // Only override draw() if you perform custom drawing. + // An empty implementation adversely affects performance during animation. + override func draw(_ rect: CGRect) { + // Drawing code + } + */ + +} diff --git a/Gemini-iOS/Resources/browser.css b/Gemini-iOS/Resources/browser.css index 951f54f..c57fbcd 100644 --- a/Gemini-iOS/Resources/browser.css +++ b/Gemini-iOS/Resources/browser.css @@ -1,3 +1,7 @@ +:root { + color-scheme: light dark; +} + body { font-family: ui-serif; overflow-wrap: break-word; @@ -40,11 +44,6 @@ ul { } @media (prefers-color-scheme: dark) { - body { - background-color: black; - color: white; - } - a { color: rgb(10, 132, 255); }