Skip to content

Commit

Permalink
Added close tab shortcut (ctrl+w)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrlabs committed Sep 13, 2024
1 parent 112ff31 commit 8c9a3ff
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 25 deletions.
5 changes: 3 additions & 2 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added
- Setting to disable pressure sensitivity and always draw with a constant brush width
- Quit shortcut (CTRL+Q by default)
- Quit shortcut (`CTRL+Q` by default)
- Alternative way to pan the canvas by holding `SPACE` and moving the mouse
- Brush stroke stabilizer/smoothing
- Translations: Ukrainian, Arabic
- Translations: Ukrainian, Arabic

### Fixed
- Fixed SVG export for brush strokes that have been moved using the move tool
Expand All @@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Migrated from Godot 3.5.x to Godot 4.3
- UI overhaul
- Improved icon resolution on Windows
- Disabled all audio functionality inherited from Godot

## [0.6.0] - 2023-11-06

Expand Down
1 change: 1 addition & 0 deletions lorien/Assets/I18n/de.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ DELETE Löschen
ACTION_shortcut_save_project Datei speichern
ACTION_shortcut_new_project Neue Datei
ACTION_shortcut_open_project Datei öffnen
ACTION_shortcut_close_project Datei schließen
ACTION_shortcut_quit Schließen
ACTION_shortcut_undo Undo
ACTION_shortcut_redo Redo
Expand Down
15 changes: 2 additions & 13 deletions lorien/Assets/I18n/en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ DELETE Delete
ACTION_shortcut_save_project Save File
ACTION_shortcut_new_project New File
ACTION_shortcut_open_project Open File
ACTION_shortcut_close_project Close File
ACTION_shortcut_quit Quit
ACTION_shortcut_undo Undo
ACTION_shortcut_redo Redo
Expand All @@ -159,16 +160,4 @@ ACTION_duplicate_strokes Duplicate strokes
ACTION_toggle_zen_mode Toggle Zen Mode
ACTION_toggle_player Toggle Easteregg
ACTION_toggle_fullscreen Toggle Fullscreen
ACTION_canvas_pan_key Pan Key

# -----------------------------------------------------------------------------
# Kebindings dialog messages
# -----------------------------------------------------------------------------

# Bind key dialog
KEYBINDING_DIALOG_BIND_WINDOW_NAME Bind key
KEYBINDING_DIALOG_BIND_ACTION Action: {action}

# Rebind already bound key dialog
KEYBINDING_DIALOG_REBIND_WINDOW_NAME Rebind key?
KEYBINDING_DIALOG_REBIND_MESSAGE '{event}' already is bound to {action}.\n\nDo you want to rebind?
ACTION_canvas_pan_key Pan Key
2 changes: 1 addition & 1 deletion lorien/InfiniteCanvas/PanZoomCamera.gd
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,6 @@ func xform(pos: Vector2) -> Vector2:
return (pos * zoom) + offset

#--------------------------------------------------------------------------------------------------
func _notification(what):
func _notification(what: int) -> void:
if what == NOTIFICATION_WM_MOUSE_EXIT:
_pan_active = false
13 changes: 8 additions & 5 deletions lorien/Main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func _ready() -> void:
_main_menu.open_url.connect(_on_open_url)
_main_menu.open_about_dialog.connect(_on_open_about_dialog)
_main_menu.export_svg.connect(_export_svg)
_main_menu.quit.connect(_quit)
_main_menu.quit.connect(_on_quit)

_unsaved_changes_dialog.save_changes.connect(_on_save_unsaved_changes)
_unsaved_changes_dialog.discard_changes.connect(_on_discard_unsaved_changes)
Expand Down Expand Up @@ -103,7 +103,7 @@ func _ready() -> void:
# -------------------------------------------------------------------------------------------------
func _notification(what: int) -> void:
if NOTIFICATION_WM_CLOSE_REQUEST == what:
_quit()
_on_quit()
elif NOTIFICATION_APPLICATION_FOCUS_IN == what:
Engine.max_fps = Settings.get_value(Settings.RENDERING_FOREGROUND_FPS, Config.DEFAULT_FOREGROUND_FPS)
if !_is_mouse_on_ui() && _canvas != null && !is_dialog_open():
Expand Down Expand Up @@ -144,13 +144,16 @@ func _unhandled_input(event: InputEvent) -> void:
if Utils.is_action_pressed("shortcut_new_project", event):
_on_create_new_project()
elif Utils.is_action_pressed("shortcut_open_project", event):
_toolbar._on_OpenFileButton_pressed()
_toolbar._on_open_project_pressed()
elif Utils.is_action_pressed("shortcut_save_project", event):
_on_save_project()
elif Utils.is_action_pressed("shortcut_close_project", event):
if ProjectManager.get_project_count() > 0:
_on_project_closed(ProjectManager.get_active_project().id)
elif Utils.is_action_pressed("shortcut_export_project", event):
_export_svg()
elif Utils.is_action_pressed("shortcut_quit", event):
_quit()
_on_quit()
elif Utils.is_action_pressed("shortcut_undo", event):
_on_undo_action()
elif Utils.is_action_pressed("shortcut_redo", event):
Expand Down Expand Up @@ -219,7 +222,7 @@ func _apply_state() -> void:
_make_project_active(active_project)

# -------------------------------------------------------------------------------------------------
func _quit() -> void:
func _on_quit() -> void:
if ProjectManager.has_unsaved_changes():
_exit_requested = true
_unsaved_changes_window.popup_centered()
Expand Down
8 changes: 4 additions & 4 deletions lorien/UI/Menubar.gd
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ var _tabs_map: Dictionary # Dictonary<project_id, ProjectTab>

# -------------------------------------------------------------------------------------------------
func _ready() -> void:
_menu_button.pressed.connect(_on_MenuButton_pressed)
_new_file_button.pressed.connect(_on_NewFileButton_pressed)
_menu_button.pressed.connect(_on_menu_button_pressed)
_new_file_button.pressed.connect(_on_new_file_button_pressed)

# -------------------------------------------------------------------------------------------------
func make_tab(project: Project) -> void:
Expand Down Expand Up @@ -83,11 +83,11 @@ func _on_tab_selected(tab: ProjectTab) -> void:
project_selected.emit(tab.project_id)

# -------------------------------------------------------------------------------------------------
func _on_NewFileButton_pressed() -> void:
func _on_new_file_button_pressed() -> void:
create_new_project.emit()

# -------------------------------------------------------------------------------------------------
func _on_MenuButton_pressed() -> void:
func _on_menu_button_pressed() -> void:
var menu: MainMenu = get_node(_main_menu_path)
menu.popup_on_parent(_menu_button.get_rect())

Expand Down
5 changes: 5 additions & 0 deletions lorien/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ shortcut_save_project={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":83,"physical_keycode":0,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
]
}
shortcut_close_project={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":87,"physical_keycode":0,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
]
}
shortcut_undo={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":90,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
Expand Down

0 comments on commit 8c9a3ff

Please sign in to comment.