ref: c1790ce4d49b170660e641d9b8a3b923dde2c269
parent: 52ebaa6c60bf90f3b7b326b94723c1999ea99655
author: Philip Silva <philip.silva@protonmail.com>
date: Mon Feb 8 12:54:21 EST 2021
remove obsolete feature flags
--- a/cmd/browse/main.go
+++ b/cmd/browse/main.go
@@ -24,8 +24,6 @@
var log *logger.Logger
var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to file")
-var cssFonts = flag.Bool("cssFonts", true, "toggle css fonts (default true)")
-var experimentalUseBoxBackgrounds = flag.Bool("experimentalUseBoxBackgrounds", true, "show box BGs (default true)")
var startPage = flag.String("startPage", "http://9p.io", "")
var dbg = flag.Bool("debug", false, "show debug logs")
@@ -176,8 +174,6 @@
log = logger.Log
log.Debug = *dbg
- style.CssFonts = *cssFonts
- style.ExperimentalUseBoxBackgrounds = *experimentalUseBoxBackgrounds
if err := Main(); err != nil {
log.Fatalf("Main: %v", err)
--- a/style/experimental.go
+++ b/style/experimental.go
@@ -28,29 +28,27 @@
}
func (cs Map) BoxBackground() (i *draw.Image, err error) {
- if ExperimentalUseBoxBackgrounds {
- var bgImg *draw.Image
+ var bgImg *draw.Image
- bgImg = cs.backgroundImage()
+ bgImg = cs.backgroundImage()
- if bgImg == nil {
- bgColor, ok := cs.backgroundColor()
- if !ok {
- return
+ if bgImg == nil {
+ bgColor, ok := cs.backgroundColor()
+ if !ok {
+ return
+ }
+ log.Printf("bgColor=%+v", bgColor)
+ i, ok = colorCache[bgColor]
+ if !ok {
+ var err error
+ i, err = dui.Display.AllocImage(image.Rect(0, 0, 10, 10), draw.ARGB32, true, bgColor)
+ if err != nil {
+ return nil, fmt.Errorf("alloc img: %w", err)
}
- log.Printf("bgColor=%+v", bgColor)
- i, ok = colorCache[bgColor]
- if !ok {
- var err error
- i, err = dui.Display.AllocImage(image.Rect(0, 0, 10, 10), draw.ARGB32, true, bgColor)
- if err != nil {
- return nil, fmt.Errorf("alloc img: %w", err)
- }
- colorCache[bgColor] = i
- }
- } else {
- i = bgImg
+ colorCache[bgColor] = i
}
+ } else {
+ i = bgImg
}
return
}
--- a/style/stylesheets.go
+++ b/style/stylesheets.go
@@ -16,12 +16,8 @@
"strings"
)
-var CssFonts = true
var fontCache = make(map[string]*draw.Font)
-// experimentalUseBoxBackgrounds should probably be combined with
-// setting stashElements to false
-var ExperimentalUseBoxBackgrounds = false
var dui *duit.DUI
var availableFontNames []string
var log *logger.Logger
@@ -274,9 +270,6 @@
}
func (cs Map) Font() *draw.Font {
- if !CssFonts {
- return nil
- }
fn := cs.FontFilename()
if dui == nil {
return nil