mirror of
https://github.com/felixangell/phi.git
synced 2024-07-14 19:00:33 +03:00
more default value configs; make the default editor size larger
This commit is contained in:
parent
9aa8e44fb3
commit
68c3a94c12
@ -20,7 +20,7 @@ func main() {
|
||||
windowConfig.Alias = config.Render.Aliased
|
||||
windowConfig.VerticalSync = config.Render.VerticalSync
|
||||
|
||||
scaledWidth, scaledHeight := calcScaledWindowDimension()
|
||||
scaledWidth, scaledHeight := calcScaledWindowDimension(800, 600)
|
||||
window := strife.SetupRenderWindow(scaledWidth, scaledHeight, windowConfig)
|
||||
window.AllowHighDPI()
|
||||
window.SetTitle("Hello world!")
|
||||
@ -88,15 +88,13 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
func calcScaledWindowDimension() (int, int) {
|
||||
ww, wh := float32(640.0), float32(360.0)
|
||||
|
||||
func calcScaledWindowDimension(width, height float32) (int, int) {
|
||||
dpi, defDpi := strife.GetDisplayDPI(0)
|
||||
|
||||
cfg.ScaleFactor = float64(dpi / defDpi)
|
||||
|
||||
scaledWidth := int((ww * dpi) / defDpi)
|
||||
scaledHeight := int((wh * dpi) / defDpi)
|
||||
scaledWidth := int((width * dpi) / defDpi)
|
||||
scaledHeight := int((height * dpi) / defDpi)
|
||||
return scaledWidth, scaledHeight
|
||||
}
|
||||
|
||||
|
@ -170,10 +170,10 @@ func NewDefaultConfig() *PhiEditorConfig {
|
||||
},
|
||||
},
|
||||
Cursor: &CursorConfig{
|
||||
FlashRate: 0,
|
||||
ResetDelay: 0,
|
||||
FlashRate: 400, // in ms
|
||||
ResetDelay: 400,
|
||||
Draw: true,
|
||||
Flash: false,
|
||||
Flash: true,
|
||||
BlockWidth: "block",
|
||||
},
|
||||
Commands: map[string]Command{
|
||||
@ -190,6 +190,12 @@ func NewDefaultConfig() *PhiEditorConfig {
|
||||
"close_buffer": {"super+w"},
|
||||
"delete_line": {"super+d"},
|
||||
},
|
||||
Associations: map[string]FileAssociations{
|
||||
"c": {Extensions: []string{".c", ".h", ".cc"}},
|
||||
"go": {Extensions: []string{".go"}},
|
||||
"md": {Extensions: []string{".md", ".markdown"}},
|
||||
"toml": {Extensions: []string{".toml"}},
|
||||
},
|
||||
|
||||
// TODO syntax defaults
|
||||
associations: map[string]*LanguageSyntaxConfig{},
|
||||
|
Loading…
Reference in New Issue
Block a user