Indicate current snapshot

Since 02b0ecdacb, the selected snapshot is no longer the currently
active one. This adds a dedicated indicator for this.
This commit is contained in:
Robin Gareus 2022-08-10 03:20:29 +02:00
parent b5d96f0de2
commit df66482b89
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 11 additions and 2 deletions

View File

@ -52,6 +52,7 @@ EditorSnapshots::EditorSnapshots ()
{
_snapshot_model = ListStore::create (_columns);
_snapshot_display.set_model (_snapshot_model);
_snapshot_display.append_column ("", _columns.current_active);
_snapshot_display.append_column (_("Snapshot (dbl-click to load)"), _columns.visible_name);
_snapshot_display.append_column (_("Modified Date"), _columns.time_formatted);
_snapshot_display.set_size_request (75, -1);
@ -236,6 +237,11 @@ EditorSnapshots::redisplay ()
g_stat (s.c_str(), &gsb);
Glib::DateTime gdt(Glib::DateTime::create_now_local (gsb.st_mtime));
if (_session->snap_name() == display_name) {
row[_columns.current_active] = "\u25B6"; // BLACK RIGHT-POINTING TRIANGLE
} else {
row[_columns.current_active] = "";
}
row[_columns.visible_name] = display_name;
row[_columns.real_name] = statename;
row[_columns.time_formatted] = gdt.format ("%F %H:%M");

View File

@ -21,11 +21,12 @@
#ifndef __gtk_ardour_editor_snapshots_h__
#define __gtk_ardour_editor_snapshots_h__
#include <gtkmm/widget.h>
#include "ardour/session_handle.h"
#include <gtkmm/liststore.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/treemodel.h>
#include <gtkmm/treeview.h>
#include "editor_component.h"
class EditorSnapshots : public ARDOUR::SessionHandlePtr
{
@ -46,10 +47,12 @@ private:
struct Columns : public Gtk::TreeModel::ColumnRecord {
Columns () {
add (current_active);
add (visible_name);
add (real_name);
add (time_formatted);
}
Gtk::TreeModelColumn<std::string> current_active;
Gtk::TreeModelColumn<std::string> visible_name;
Gtk::TreeModelColumn<std::string> real_name;
Gtk::TreeModelColumn<std::string> time_formatted;