library manager: display description in textview not tooltip
This commit is contained in:
parent
e42de1e229
commit
5e26c9c277
@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
#include "gui_thread.h"
|
#include "gui_thread.h"
|
||||||
#include "library_download_dialog.h"
|
#include "library_download_dialog.h"
|
||||||
|
#include "ui_config.h"
|
||||||
|
|
||||||
using namespace PBD;
|
using namespace PBD;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
@ -53,7 +54,7 @@ LibraryDownloadDialog::LibraryDownloadDialog ()
|
|||||||
append_progress_column ();
|
append_progress_column ();
|
||||||
|
|
||||||
_display.set_headers_visible (true);
|
_display.set_headers_visible (true);
|
||||||
_display.set_tooltip_column (5); /* path */
|
_display.set_hover_selection (true);
|
||||||
|
|
||||||
_display.signal_button_press_event().connect (sigc::mem_fun (*this, &LibraryDownloadDialog::display_button_press), false);
|
_display.signal_button_press_event().connect (sigc::mem_fun (*this, &LibraryDownloadDialog::display_button_press), false);
|
||||||
|
|
||||||
@ -63,8 +64,15 @@ LibraryDownloadDialog::LibraryDownloadDialog ()
|
|||||||
h->pack_start (_display);
|
h->pack_start (_display);
|
||||||
|
|
||||||
get_vbox()->set_spacing (8);
|
get_vbox()->set_spacing (8);
|
||||||
|
get_vbox()->set_border_width (12);
|
||||||
get_vbox()->pack_start (*Gtk::manage (h));
|
get_vbox()->pack_start (*Gtk::manage (h));
|
||||||
|
|
||||||
|
_display.get_selection()->set_mode (Gtk::SELECTION_SINGLE);
|
||||||
|
_display.get_selection()->signal_changed().connect (sigc::mem_fun (*this, &LibraryDownloadDialog::library_selected));
|
||||||
|
|
||||||
|
description_view.set_size_request (-1, 80);
|
||||||
|
description_view.set_wrap_mode (Gtk::WRAP_WORD);
|
||||||
|
get_vbox()->pack_start (description_view);
|
||||||
|
|
||||||
ARDOUR::LibraryFetcher lf;
|
ARDOUR::LibraryFetcher lf;
|
||||||
lf.get_descriptions ();
|
lf.get_descriptions ();
|
||||||
@ -76,6 +84,19 @@ LibraryDownloadDialog::~LibraryDownloadDialog ()
|
|||||||
delete inflater;
|
delete inflater;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LibraryDownloadDialog::library_selected ()
|
||||||
|
{
|
||||||
|
if (_display.get_selection()->count_selected_rows() == 0) {
|
||||||
|
description_view.get_buffer()->set_text (string());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Gtk::TreeModel::iterator row = _display.get_selection()->get_selected();
|
||||||
|
string txt = (*row)[_columns.description];
|
||||||
|
description_view.get_buffer()->set_text (txt);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LibraryDownloadDialog::append_progress_column ()
|
LibraryDownloadDialog::append_progress_column ()
|
||||||
{
|
{
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <gtkmm/entry.h>
|
#include <gtkmm/entry.h>
|
||||||
#include <gtkmm/liststore.h>
|
#include <gtkmm/liststore.h>
|
||||||
#include <gtkmm/treeview.h>
|
#include <gtkmm/treeview.h>
|
||||||
|
#include <gtkmm/textview.h>
|
||||||
|
|
||||||
#include "ardour_dialog.h"
|
#include "ardour_dialog.h"
|
||||||
|
|
||||||
@ -111,6 +112,9 @@ class LibraryDownloadDialog : public ArdourDialog
|
|||||||
void install_progress (size_t, size_t, std::string, Gtk::TreePath);
|
void install_progress (size_t, size_t, std::string, Gtk::TreePath);
|
||||||
void install_finished (Gtk::TreeModel::iterator row, std::string path, int status);
|
void install_finished (Gtk::TreeModel::iterator row, std::string path, int status);
|
||||||
PBD::ScopedConnection install_connection;
|
PBD::ScopedConnection install_connection;
|
||||||
|
|
||||||
|
Gtk::TextView description_view;
|
||||||
|
void library_selected ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user