mirror of https://github.com/gmbrax/Pilgrim.git
				
				
				
			Compare commits
	
		
			1 Commits
		
	
	
		
			6ef0b3f6b3
			...
			9d259d2119
		
	
	| Author | SHA1 | Date | 
|---|---|---|
| 
							
							
								 | 
						9d259d2119 | 
| 
						 | 
					@ -87,7 +87,7 @@ class EditEntryScreen(Screen):
 | 
				
			||||||
        self.text_entry = TextArea(id="text_entry", classes="EditEntryScreen-text-entry")
 | 
					        self.text_entry = TextArea(id="text_entry", classes="EditEntryScreen-text-entry")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Sidebar widgets
 | 
					        # Sidebar widgets
 | 
				
			||||||
        self.sidebar_title = Static("Photos", classes="EditEntryScreen-sidebar-title")
 | 
					        self.sidebar_title = Static("📸 Photos", classes="EditEntryScreen-sidebar-title")
 | 
				
			||||||
        self.photo_list = OptionList(id="photo_list", classes="EditEntryScreen-sidebar-photo-list")
 | 
					        self.photo_list = OptionList(id="photo_list", classes="EditEntryScreen-sidebar-photo-list")
 | 
				
			||||||
        self.photo_info = Static("", classes="EditEntryScreen-sidebar-photo-info")
 | 
					        self.photo_info = Static("", classes="EditEntryScreen-sidebar-photo-info")
 | 
				
			||||||
        self.help_text = Static("", classes="EditEntryScreen-sidebar-help")
 | 
					        self.help_text = Static("", classes="EditEntryScreen-sidebar-help")
 | 
				
			||||||
| 
						 | 
					@ -296,28 +296,30 @@ class EditEntryScreen(Screen):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if not self.cached_photos:
 | 
					            if not self.cached_photos:
 | 
				
			||||||
                self.photo_info.update("No photos found for this diary")
 | 
					                self.photo_info.update("No photos found for this diary")
 | 
				
			||||||
                self.help_text.update("No photos available\n\nUse Photo Manager to add photos")
 | 
					                self.help_text.update("📸 No photos available\n\nUse Photo Manager to add photos")
 | 
				
			||||||
                return
 | 
					                return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            # Add photos to the list with hash
 | 
					            # Add photos to the list with hash
 | 
				
			||||||
            for photo in self.cached_photos:
 | 
					            for photo in self.cached_photos:
 | 
				
			||||||
                # Show name and hash in the list
 | 
					                # Show name and hash in the list
 | 
				
			||||||
                photo_hash = str(photo.photo_hash)[:8]
 | 
					                photo_hash = str(photo.photo_hash)[:8]
 | 
				
			||||||
                self.photo_list.add_option(f"{photo.name} \\[{photo_hash}\]")
 | 
					                self.photo_list.add_option(f"📷 {photo.name} \\[{photo_hash}\]")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            self.photo_info.update(f"{len(self.cached_photos)} photos in diary")
 | 
					            self.photo_info.update(f"📸 {len(self.cached_photos)} photos in diary")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            # Updated help a text with hash information
 | 
					            # Updated help a text with hash information
 | 
				
			||||||
            help_text = (
 | 
					            help_text = (
 | 
				
			||||||
                "[b]Sidebar Shortcuts[/b]\n"
 | 
					                "[b]⌨️  Sidebar Shortcuts[/b]\n"
 | 
				
			||||||
                "[b][green]i[/green][/b]: Insert photo into entry\n"
 | 
					                "[b][green]i[/green][/b]: Insert photo into entry\n"
 | 
				
			||||||
                "[b][green]n[/green][/b]: Add new photo\n"
 | 
					                "[b][green]n[/green][/b]: Add new photo\n"
 | 
				
			||||||
                "[b][green]d[/green][/b]: Delete selected photo\n"
 | 
					                "[b][green]d[/green][/b]: Delete selected photo\n"
 | 
				
			||||||
                "[b][green]e[/green][/b]: Edit selected photo\n"
 | 
					                "[b][green]e[/green][/b]: Edit selected photo\n"
 | 
				
			||||||
                "[b][yellow]Tab[/yellow][/b]: Back to editor\n"
 | 
					                "[b][yellow]Tab[/yellow][/b]: Back to editor\n"
 | 
				
			||||||
                "[b][yellow]F8[/yellow][/b]: Show/hide sidebar\n"
 | 
					                "[b][yellow]F8[/yellow][/b]: Show/hide sidebar\n"
 | 
				
			||||||
 | 
					                "[b][yellow]F9[/yellow][/b]: Switch focus (if needed)\n\n"
 | 
				
			||||||
                "[b]📝 Photo References[/b]\n"
 | 
					                "[b]📝 Photo References[/b]\n"
 | 
				
			||||||
                "\\[\\[photo::hash\\]\\]"
 | 
					                "Use: \\[\\[photo:name:hash\\]\\]\n"
 | 
				
			||||||
 | 
					                "Or: \\[\\[photo::hash\\]\\]"
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
            self.help_text.update(help_text)
 | 
					            self.help_text.update(help_text)
 | 
				
			||||||
        except Exception as e:
 | 
					        except Exception as e:
 | 
				
			||||||
| 
						 | 
					@ -427,7 +429,9 @@ class EditEntryScreen(Screen):
 | 
				
			||||||
        photo_details += f"🔗 {photo_hash}\n"
 | 
					        photo_details += f"🔗 {photo_hash}\n"
 | 
				
			||||||
        photo_details += f"📅 {selected_photo.addition_date}\n"
 | 
					        photo_details += f"📅 {selected_photo.addition_date}\n"
 | 
				
			||||||
        photo_details += f"💬 {selected_photo.caption or 'No caption'}\n"
 | 
					        photo_details += f"💬 {selected_photo.caption or 'No caption'}\n"
 | 
				
			||||||
 | 
					        photo_details += f"📁 {selected_photo.filepath}\n\n"
 | 
				
			||||||
        photo_details += f"[b]Reference formats:[/b]\n"
 | 
					        photo_details += f"[b]Reference formats:[/b]\n"
 | 
				
			||||||
 | 
					        photo_details += f"\\[\\[photo:{selected_photo.name}:{photo_hash}\\]\\]\n"
 | 
				
			||||||
        photo_details += f"\\[\\[photo::{photo_hash}\\]\\]"
 | 
					        photo_details += f"\\[\\[photo::{photo_hash}\\]\\]"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.photo_info.update(photo_details)
 | 
					        self.photo_info.update(photo_details)
 | 
				
			||||||
| 
						 | 
					@ -738,15 +742,15 @@ class EditEntryScreen(Screen):
 | 
				
			||||||
        self.notify(f"Selected photo: {selected_photo.name} \\[{photo_hash}\\]")
 | 
					        self.notify(f"Selected photo: {selected_photo.name} \\[{photo_hash}\\]")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Update photo info with details including hash
 | 
					        # Update photo info with details including hash
 | 
				
			||||||
        photo_details = f"Name: {selected_photo.name}\n"
 | 
					        photo_details = f"📷 {selected_photo.name}\n"
 | 
				
			||||||
        photo_details += f"Hash: {photo_hash}\n"
 | 
					        photo_details += f"🔗 {photo_hash}\n"
 | 
				
			||||||
        photo_details += f"Date: {selected_photo.addition_date}\n"
 | 
					        photo_details += f"📅 {selected_photo.addition_date}\n"
 | 
				
			||||||
        if selected_photo.caption:
 | 
					        if selected_photo.caption:
 | 
				
			||||||
            photo_details += f"Caption: {selected_photo.caption}\n"
 | 
					            photo_details += f"💬 {selected_photo.caption}\n"
 | 
				
			||||||
        else:
 | 
					        photo_details += f"📁 {selected_photo.filepath}\n\n"
 | 
				
			||||||
            photo_details += f"Caption: No Caption\n"
 | 
					 | 
				
			||||||
        photo_details += f"[b]Reference formats:[/b]\n"
 | 
					        photo_details += f"[b]Reference formats:[/b]\n"
 | 
				
			||||||
        photo_details += f"\\[\\[photo::{photo_hash}]]"
 | 
					        photo_details += f"\\[\\[photo:{selected_photo.name}:{photo_hash}\\]\\]\n"
 | 
				
			||||||
 | 
					        photo_details += f"\\[\\[photo::{photo_hash}\\]\\]"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.photo_info.update(photo_details)
 | 
					        self.photo_info.update(photo_details)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -390,9 +390,21 @@ Screen.-modal {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.EditEntryScreen-sidebar {
 | 
					.EditEntryScreen-sidebar {
 | 
				
			||||||
    background: $primary-darken-1;
 | 
					    width: 40;
 | 
				
			||||||
    width: 45%;
 | 
					    min-height: 10;
 | 
				
			||||||
 | 
					    border-left: solid green;
 | 
				
			||||||
 | 
					    padding: 1;
 | 
				
			||||||
 | 
					    background: $surface-darken-2;
 | 
				
			||||||
 | 
					    color: $primary;
 | 
				
			||||||
 | 
					    text-style: bold;
 | 
				
			||||||
 | 
					    content-align: left top;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.EditEntryScreen-content-container {
 | 
				
			||||||
 | 
					    layout: horizontal;
 | 
				
			||||||
 | 
					    height: 1fr;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.EditEntryScreen-sidebar-title {
 | 
					.EditEntryScreen-sidebar-title {
 | 
				
			||||||
    text-align: center;
 | 
					    text-align: center;
 | 
				
			||||||
    text-style: bold;
 | 
					    text-style: bold;
 | 
				
			||||||
| 
						 | 
					@ -405,39 +417,30 @@ Screen.-modal {
 | 
				
			||||||
.EditEntryScreen-sidebar-content {
 | 
					.EditEntryScreen-sidebar-content {
 | 
				
			||||||
    height: 1fr;
 | 
					    height: 1fr;
 | 
				
			||||||
    layout: vertical;
 | 
					    layout: vertical;
 | 
				
			||||||
    margin-left: 1;
 | 
					 | 
				
			||||||
    margin-right: 1;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.EditEntryScreen-sidebar-photo-list {
 | 
					.EditEntryScreen-sidebar-photo-list {
 | 
				
			||||||
    height: 2fr; /* Pega o espaço restante disponível */
 | 
					    height: 1fr;
 | 
				
			||||||
    min-height: 5; /* Garante altura mínima para não sumir */
 | 
					 | 
				
			||||||
    border: solid $accent;
 | 
					    border: solid $accent;
 | 
				
			||||||
    margin-bottom: 1;
 | 
					    margin-bottom: 1;
 | 
				
			||||||
    overflow-y: auto; /* Adiciona scroll vertical se necessário */
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.EditEntryScreen-sidebar-photo-info {
 | 
					.EditEntryScreen-sidebar-photo-info {
 | 
				
			||||||
    height: 1fr;
 | 
					    height: auto;
 | 
				
			||||||
    max-height: 15; /* Limita altura máxima */
 | 
					    min-height: 3;
 | 
				
			||||||
    min-height: 13;
 | 
					 | 
				
			||||||
    padding: 1;
 | 
					 | 
				
			||||||
    border: solid $warning;
 | 
					    border: solid $warning;
 | 
				
			||||||
 | 
					    padding: 1;
 | 
				
			||||||
    margin-bottom: 1;
 | 
					    margin-bottom: 1;
 | 
				
			||||||
    background: $surface-darken-1;
 | 
					    background: $surface-darken-1;
 | 
				
			||||||
    overflow-y: auto; /* Adiciona scroll se exceder max-height */
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.EditEntryScreen-sidebar-help {
 | 
					.EditEntryScreen-sidebar-help {
 | 
				
			||||||
    height: 1fr;
 | 
					    height: auto;
 | 
				
			||||||
    max-height: 10; /* Altura máxima menor que info */
 | 
					    min-height: 8;
 | 
				
			||||||
    min-height: 8; /* Altura mínima menor */
 | 
					 | 
				
			||||||
    border: solid $success;
 | 
					    border: solid $success;
 | 
				
			||||||
    padding: 1;
 | 
					    padding: 1;
 | 
				
			||||||
    background: $surface-darken-1;
 | 
					    background: $surface-darken-1;
 | 
				
			||||||
    text-style: italic;
 | 
					    text-style: italic;
 | 
				
			||||||
    overflow-y: auto; /* Adiciona scroll se exceder max-height */
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Photo Modal Styles */
 | 
					/* Photo Modal Styles */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue