Skip to content

Commit

Permalink
Implement tab overrun logic (#1141)
Browse files Browse the repository at this point in the history
  • Loading branch information
MewPurPur authored Feb 9, 2025
1 parent 4ee4c83 commit 648a191
Show file tree
Hide file tree
Showing 11 changed files with 417 additions and 113 deletions.
1 change: 1 addition & 0 deletions assets/icons/ScrollBackwards.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions assets/icons/ScrollBackwards.svg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://b6wvqmor1sq08"
path="res://.godot/imported/ScrollBackwards.svg-1ff0ea66adb12029ac78f704d80e6248.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/icons/ScrollBackwards.svg"
dest_files=["res://.godot/imported/ScrollBackwards.svg-1ff0ea66adb12029ac78f704d80e6248.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
1 change: 1 addition & 0 deletions assets/icons/ScrollForwards.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions assets/icons/ScrollForwards.svg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://raxijmbc48q5"
path="res://.godot/imported/ScrollForwards.svg-6f6937f4ac0b631bdce59141e49cba7f.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/icons/ScrollForwards.svg"
dest_files=["res://.godot/imported/ScrollForwards.svg-6f6937f4ac0b631bdce59141e49cba7f.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
2 changes: 1 addition & 1 deletion src/config_classes/SaveData.gd
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ func erase_shortcut_panel_slot(slot: int) -> void:
Configs.shortcut_panel_changed.emit()


const MAX_TABS = 5
const MAX_TABS = 50
@export var _tabs: Array[TabData] = []:
set(new_value):
# Validation
Expand Down
3 changes: 3 additions & 0 deletions src/config_classes/TabData.gd
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ func _on_language_changed() -> void:

func _sync() -> void:
if not svg_file_path.is_empty():
# The extension is included in the presented name too.
# It's always in the end anyway so it can't hide useless info.
# And also, it prevents ".svg" from being presented as an empty string.
presented_name = svg_file_path.get_file()
is_empty_and_unsaved = false
elif SVGParser.text_check_is_root_empty(get_true_svg_text()):
Expand Down
2 changes: 1 addition & 1 deletion src/ui_parts/export_menu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func _ready() -> void:

if Configs.savedata.get_active_tab().svg_file_path.is_empty():
file_title.add_theme_color_override("font_color", ThemeUtils.common_subtle_text_color)
file_title.text = Configs.savedata.get_active_tab().get_presented_name()
file_title.text = Configs.savedata.get_active_tab().presented_name

final_size_label.text = Translator.translate("Size") + ": " +\
String.humanize_size(State.get_export_text().length())
Expand Down
3 changes: 2 additions & 1 deletion src/ui_parts/good_file_dialog.gd
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ func set_file(file: String) -> void:
file += "." + extensions[0]
file_list.ensure_current_is_visible()
current_file = file
file_field.text = current_file
if not file.is_empty():
file_field.text = file

# For optimization, only generate the visible files' images.
func _setup_file_images() -> void:
Expand Down
Loading

0 comments on commit 648a191

Please sign in to comment.