read only mode needs adjustement to 4 fields from 2

This commit is contained in:
filipriec
2025-04-10 23:04:25 +02:00
parent 337d6050ff
commit 14f9b254b2
4 changed files with 17 additions and 17 deletions

View File

@@ -156,19 +156,19 @@ impl EventHandler {
if config.is_enter_edit_mode_after(key_code, modifiers) &&
ModeManager::can_enter_edit_mode(current_mode) {
let current_input = if app_state.ui.show_login {
let current_input = if app_state.ui.show_login || app_state.ui.show_register{
auth_state.get_current_input()
} else {
form_state.get_current_input()
};
let current_cursor_pos = if app_state.ui.show_login {
let current_cursor_pos = if app_state.ui.show_login || app_state.ui.show_register{
auth_state.current_cursor_pos()
} else {
form_state.current_cursor_pos()
};
if !current_input.is_empty() && current_cursor_pos < current_input.len() {
if app_state.ui.show_login {
if app_state.ui.show_login || app_state.ui.show_register{
auth_state.set_current_cursor_pos(current_cursor_pos + 1);
self.ideal_cursor_column = auth_state.current_cursor_pos();
} else {
@@ -238,7 +238,7 @@ impl EventHandler {
self.is_edit_mode = false;
self.edit_mode_cooldown = true;
let has_changes = if app_state.ui.show_login {
let has_changes = if app_state.ui.show_login || app_state.ui.show_register{
auth_state.has_unsaved_changes()
} else {
form_state.has_unsaved_changes()
@@ -252,12 +252,12 @@ impl EventHandler {
terminal.set_cursor_style(SetCursorStyle::SteadyBlock)?;
let current_input = if app_state.ui.show_login {
let current_input = if app_state.ui.show_login || app_state.ui.show_register{
auth_state.get_current_input()
} else {
form_state.get_current_input()
};
let current_cursor_pos = if app_state.ui.show_login {
let current_cursor_pos = if app_state.ui.show_login || app_state.ui.show_register{
auth_state.current_cursor_pos()
} else {
form_state.current_cursor_pos()
@@ -265,7 +265,7 @@ impl EventHandler {
if !current_input.is_empty() && current_cursor_pos >= current_input.len() {
let new_pos = current_input.len() - 1;
if app_state.ui.show_login {
if app_state.ui.show_login || app_state.ui.show_register{
auth_state.set_current_cursor_pos(new_pos);
self.ideal_cursor_column = auth_state.current_cursor_pos();
} else {

View File

@@ -23,7 +23,7 @@ impl ModeManager {
return AppMode::General;
}
if app_state.ui.show_login {
if app_state.ui.show_login || app_state.ui.show_register {
if event_handler.is_edit_mode {
AppMode::Edit
} else {