mirror of
https://github.com/felixangell/phi.git
synced 2024-10-05 12:17:20 +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.Alias = config.Render.Aliased
|
||||||
windowConfig.VerticalSync = config.Render.VerticalSync
|
windowConfig.VerticalSync = config.Render.VerticalSync
|
||||||
|
|
||||||
scaledWidth, scaledHeight := calcScaledWindowDimension()
|
scaledWidth, scaledHeight := calcScaledWindowDimension(800, 600)
|
||||||
window := strife.SetupRenderWindow(scaledWidth, scaledHeight, windowConfig)
|
window := strife.SetupRenderWindow(scaledWidth, scaledHeight, windowConfig)
|
||||||
window.AllowHighDPI()
|
window.AllowHighDPI()
|
||||||
window.SetTitle("Hello world!")
|
window.SetTitle("Hello world!")
|
||||||
@ -88,15 +88,13 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func calcScaledWindowDimension() (int, int) {
|
func calcScaledWindowDimension(width, height float32) (int, int) {
|
||||||
ww, wh := float32(640.0), float32(360.0)
|
|
||||||
|
|
||||||
dpi, defDpi := strife.GetDisplayDPI(0)
|
dpi, defDpi := strife.GetDisplayDPI(0)
|
||||||
|
|
||||||
cfg.ScaleFactor = float64(dpi / defDpi)
|
cfg.ScaleFactor = float64(dpi / defDpi)
|
||||||
|
|
||||||
scaledWidth := int((ww * dpi) / defDpi)
|
scaledWidth := int((width * dpi) / defDpi)
|
||||||
scaledHeight := int((wh * dpi) / defDpi)
|
scaledHeight := int((height * dpi) / defDpi)
|
||||||
return scaledWidth, scaledHeight
|
return scaledWidth, scaledHeight
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ func NewDefaultConfig() *PhiEditorConfig {
|
|||||||
Outline: 0xebedef,
|
Outline: 0xebedef,
|
||||||
RenderShadow: true,
|
RenderShadow: true,
|
||||||
ShadowColor: 0x000000,
|
ShadowColor: 0x000000,
|
||||||
Suggestion: SuggestionConfig{
|
Suggestion: SuggestionConfig{
|
||||||
Background: 0xebedef,
|
Background: 0xebedef,
|
||||||
Foreground: 0x3a3839,
|
Foreground: 0x3a3839,
|
||||||
SelectedBackground: 0xc7cdb1,
|
SelectedBackground: 0xc7cdb1,
|
||||||
@ -170,10 +170,10 @@ func NewDefaultConfig() *PhiEditorConfig {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Cursor: &CursorConfig{
|
Cursor: &CursorConfig{
|
||||||
FlashRate: 0,
|
FlashRate: 400, // in ms
|
||||||
ResetDelay: 0,
|
ResetDelay: 400,
|
||||||
Draw: true,
|
Draw: true,
|
||||||
Flash: false,
|
Flash: true,
|
||||||
BlockWidth: "block",
|
BlockWidth: "block",
|
||||||
},
|
},
|
||||||
Commands: map[string]Command{
|
Commands: map[string]Command{
|
||||||
@ -190,6 +190,12 @@ func NewDefaultConfig() *PhiEditorConfig {
|
|||||||
"close_buffer": {"super+w"},
|
"close_buffer": {"super+w"},
|
||||||
"delete_line": {"super+d"},
|
"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
|
// TODO syntax defaults
|
||||||
associations: map[string]*LanguageSyntaxConfig{},
|
associations: map[string]*LanguageSyntaxConfig{},
|
||||||
|
Loading…
Reference in New Issue
Block a user