Commit graph

17 commits

Author SHA1 Message Date
Cédric Bellegarde
63472121d2 Revert "Fix crash when conversation scrolled window child changes."
This reverts commit 07966a1156.

This commit was needed due to an issue in GTK
https://bugzilla.gnome.org/show_bug.cgi?id=778190 (which was later
migrated to https://gitlab.gnome.org/GNOME/gtk/-/issues/749).

This was fixed since 3.24.24, so bump the meson version too.
2023-07-08 00:59:56 +02:00
Michael Gratton
f4d3c54110 ui: Remove can_focus from GTK builder file definitions
GTK widgets set the default for this as needed, and some incorrect
values for this have caused issues with keyboard focus.

Fixes #1059
2021-01-27 21:43:23 +11:00
Christopher Davis
54d2ce45d7 conversation-viewer: set searchentry width to same as inbox's
Previously our search entry for conversations was too small
for the placeholder text, and looked awkward in comparison
to the entry for searching messages.

Now we set them to have the same width-chars.

Fixes https://gitlab.gnome.org/GNOME/geary/issues/390
2019-04-18 23:19:44 -04:00
Michael James Gratton
71d05b6ce0 Reduce CPU use when idle.
It looks like Gtk.Spinner triggers repaints when running, even when the
widget is not visible. This ensures the conversation is stopped when not
visible.

Fix for Bug 783025.

* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer): Start the conversation spinner when showing it,
  stop the conversation spinner when it is hidden.
2018-04-09 12:31:39 +10:00
Michael James Gratton
07966a1156 Fix crash when conversation scrolled window child changes.
This is a workaround for GTK+ Bug 778190.

* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer): Replace the whole conversation scrolled window
  when changing the conversation, not just the viewport.

* ui/conversation-viewer.ui: Remove the ScrolledWindow for now since we
  are constructing it manually.
2017-02-28 21:18:07 +11:00
Michael James Gratton
56179ba066 Remove border around conversation viewer's scrolled window. 2016-12-09 15:36:06 +11:00
Michael James Gratton
3ef1ac973e Fix runtime errors when built/running against GTK +3.14.
* ui/conversation-viewer.ui,
  src/client/conversation-viewer/conversation-viewer.vala: next-match and
  previous-match signals are only available in GTK+ >= 3.16.

* ui/empty-placeholder.ui: Drop declared GTK+ requirement to 3.14.

* ui/geary.css: The :not() pseudeo class is only available in GTK+ >= 3.20.
2016-12-06 16:22:39 +11:00
Michael James Gratton
797bb44b7c Fix conversation viewer's spinners being huge with some themes.
Bug 773054

* src/client/conversation-viewer/conversation-list-box.vala
  (ConversationListBox::show_loading), ui/conversation-viewer.ui: Specify
  a width and height request for the spinners, ensure they are centered.
2016-10-25 10:03:42 +11:00
Michael James Gratton
124273da45 Explicitly handle find bar being closed, update search terms if set. 2016-10-04 10:58:17 +11:00
Michael James Gratton
d157fa0472 Clean up the conversation find implementation a bit.
* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer): Move notify::search-mode-enabled handler to UI
  file, remove old unused FSM code.
2016-10-04 10:58:17 +11:00
Michael James Gratton
dca845d840 Reimplement in-conversation find.
* src/client/application/geary-controller.vala (GearyController): Remove
  ACTION_FIND_NEXT_IN_CONVERSATION and
  ACTION_FIND_PREVIOUS_IN_CONVERSATION arctions and callbacks since they
  will be taken care of by the search entry & search bar buttons, and
  remove from accelerators.ui. Add ACTION_TOGGLE_FIND action to handle
  toggling find bar in the same way as the search bar.

* src/client/components/main-toolbar.vala (MainToolbar): Add new button
  and infrastrcuture for toggling the find bar.

* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer): Convert ::conversation_page to be grid, add new
  ::conversation_scroller property for the scrollbar, update call
  sites. Add props for accessing find widgets, remove old find methods
  and add callbacks for handling find start, change, etc.

* src/client/conversation-viewer/conversation-email.vala,
  src/client/conversation-viewer/conversation-message.vala: Add methods
  for accessing selected text for find.

* src/client/conversation-viewer/conversation-listbox.vala
  (ConversationListBox::highlight_search_terms): Updated to return a flag
  specifiying whether any search results were found, and to
  expand/collapse messsages depending on whether they have any.

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage::highlight_search_terms): Keep track of how many
  results were found, and return that.

* ui/conversation-viewer.ui: Convert conversation_page to be a grid, add
  a search bar and search widgets to it, and move conversation
  ScrolledWindow to it.
2016-10-04 10:58:17 +11:00
Michael James Gratton
b03c0add14 Convert new convo widgets to use Gtk.Grid instead of Box. 2016-10-04 10:58:17 +11:00
Michael James Gratton
d467647153 Break out ListBox used to display conversations into standalone widget.
The conversation viewer's ListBox is sufficiently complex to warrant its
own widget. Use empty placeholders for the list per the HIG, and
correctly fix mamagement of empty folder vs no conversations selected
this time.

* src/client/application/geary-controller.vala (GearyController):
  Directly manage secondary parts of the conversation viewer, since the
  controller since it has a better and more timely idea of when a
  conversation change is due to folder loading status or from the user
  selecting conversations, and so the viwer doesn't need to hook back
  into the controller. Remove the now-unused conversations_selected
  signal and its callers.

* src/client/conversation-viewer/conversation-listbox.vala: New widget
  for displaying the list of emails for a conversation. Moved relevant
  code from ConversationViewer here. Made adding emails async to get
  better UI responsiveness. Don't implement anything to handle
  conversation changes or emptying the list.

* src/client/conversation-viewer/conversation-viewer.vala: Replace user
  messages - empty folder/search & no/multiple messages selected with new
  EmptyPlaceholder. Remove a lot of the state manage code needed when
  managing the email listbox. Add a new ConversationListBox for every new
  conversation and just throw away.

* src/client/conversation-list/conversation-list-view.vala
  (ConversationListView): Clean up firing the conversations_selected
  signal - don't actually emit it when the model is clearing, and don't
  bother delaying the check either.

* src/client/components/empty-placeholder.vala: New widget for displaying
  empty list and grid placeholders per the HIG.

* src/client/conversation-viewer/conversation-email.vala
  (ConversationEmail): Make manually read a property, since it
  effectively is one.

* src/CMakeLists.txt: Include new source files.

* po/POTFILES.in: Include new source and UI files, and some missing ones.

* ui/CMakeLists.txt: Include new UI files.

* ui/conversation-viewer.ui: Replace user message and splash page with
  placeholders for the new empty placeholders(!).

* ui/empty-placeholder.ui: UI def for new widget class.

* ui/geary.css: Chase widget name/class changes, style new
  empty placeholder UI.
2016-10-04 10:58:17 +11:00
Michael James Gratton
1c6745256e Emulate browser-style scroll-on-spacebar. 2016-10-04 10:58:17 +11:00
Michael James Gratton
89a1dc8c88 Style the ConversationViewer user message with CSS rather than a class. 2016-10-04 10:58:17 +11:00
Michael James Gratton
5184a38fe8 Reenable and update code for attached, full pane message composer.
Display attached+un-embedded composer as an additional ConversationViewer
stack page, although it realy should be broken as its own top-level
widget - there's already too much state in ConversationViewer.

* src/client/conversation-viewer/conversation-viewer.vala: Remove old
  composer boxes code. Add new ViewState enum, property and methods to
  define and manipulate the current view state - either conversation or
  composer.
  (do_conversation): New method to put the viewer in conversation mode.
  (do_compose): New method to put the viewer in compose mode, hook up the
  composer widget, and handle ConversationListView selection management
  for now.
  (on_folder_selected, on_conversation_count_changed,
  on_conversations_selected): Ensure these methods do the right thing
  depending on the viewer's current view state.
  (set_paned_composer): Replaced by ::do_compose, fixed call sites.
  (show_multiple_selected): Minor code clean up - moved down to a more
  appropriate location.

* src/client/composer/composer-box.vala (ComposerBox): Don't attempt to
  up-manage it's parent's state, since the parent has a much better idea
  of how best to do that. Likewise move code to manage previous
  ConversationList selection out, provide signal so the a more
  appropriate class can manage it instead.

* src/client/composer/composer-container.vala: Add some method comments.

* ui/conversation-viewer.ui: Add new page to the stack for the composer.
2016-10-04 10:58:17 +11:00
Michael James Gratton
b29d83e546 Convert ConversationViewer to a Stack with a ListBox, remove its WebView.
* src/client/conversation-viewer/conversation-viewer.vala: Convert to a
  GtkStack. Use a GTK template for constructing the UI. Remove WebView
  and any DOM-related code. Replace the enum DisplayMode and hence the
  HTML spinner and HTML user message with widgets in the stack. Remove
  all menus since they're all message specific and will need to be
  re-implemented for ConversationViewer. Comment out composer related
  code for the moment.

* src/client/application/geary-controller.vala
  (GearyController::conversations_selected): Make both conversations and
  current_folder arguments non-nullable, since it doesn't make any sense
  for there not to be any and simplifies handler impls.
  (GearyController::on_conversations_selected): Don't fire when there
  isn't a current folder.

* src/client/components/main-window.vala (MainWindow::set_styling): Add
  CSS theme code for the the conversation message list.
  (MainWindow::create_layout): Remove GtkFrame, just add the
  ConversationViewer instance directly.

* ui/conversation-viewer.ui: New GtkBuilder template for
  ConversationViewer, implemented as a GtkStack containing widgets for
  displaying the loading spinner, conversation as a GtkListBox, and label
  for user messages.

* ui/CMakeLists.txt, po/POTFILES.in: Added new UI files.
2016-10-04 10:58:17 +11:00