2022-01-20 18:27:56 +00:00
|
|
|
// This file Copyright © 2007-2022 Mnemosyne LLC.
|
2022-02-07 16:25:02 +00:00
|
|
|
// It may be used under GPLv2 (SPDX: GPL-2.0-only), GPLv3 (SPDX: GPL-3.0-only),
|
2022-01-20 18:27:56 +00:00
|
|
|
// or any future license endorsed by Mnemosyne LLC.
|
|
|
|
// License text can be found in the licenses/ folder.
|
2007-12-19 02:46:30 +00:00
|
|
|
|
2022-12-26 21:13:21 +00:00
|
|
|
#include "TorrentCellRenderer.h"
|
|
|
|
|
|
|
|
#include "HigWorkarea.h" // GUI_PAD, GUI_PAD_SMALL
|
|
|
|
#include "Torrent.h"
|
|
|
|
|
|
|
|
#include <libtransmission/transmission.h>
|
|
|
|
#include <libtransmission/utils.h> /* tr_truncd() */
|
2021-10-18 20:22:31 +00:00
|
|
|
|
2022-12-27 01:43:20 +00:00
|
|
|
#include <cairomm/context.h>
|
|
|
|
#include <cairomm/refptr.h>
|
|
|
|
#include <cairomm/surface.h>
|
|
|
|
#include <gdkmm/rectangle.h>
|
|
|
|
#include <gdkmm/rgba.h>
|
|
|
|
#include <giomm/icon.h>
|
2021-10-18 20:22:31 +00:00
|
|
|
#include <glibmm.h>
|
|
|
|
#include <glibmm/i18n.h>
|
2022-12-27 01:43:20 +00:00
|
|
|
#include <glibmm/property.h>
|
|
|
|
#include <gtkmm/cellrendererpixbuf.h>
|
|
|
|
#include <gtkmm/cellrendererprogress.h>
|
|
|
|
#include <gtkmm/cellrenderertext.h>
|
|
|
|
#include <gtkmm/requisition.h>
|
|
|
|
|
|
|
|
#if GTKMM_CHECK_VERSION(4, 0, 0)
|
|
|
|
#include <gtkmm/snapshot.h>
|
|
|
|
#endif
|
2021-10-18 20:22:31 +00:00
|
|
|
|
2022-03-21 14:15:48 +00:00
|
|
|
#include <fmt/core.h>
|
|
|
|
|
2022-12-26 21:13:21 +00:00
|
|
|
#include <algorithm> // std::max()
|
|
|
|
#include <cstring> // strchr()
|
|
|
|
#include <memory>
|
|
|
|
#include <optional>
|
|
|
|
#include <string>
|
|
|
|
#include <string_view>
|
2007-12-19 02:46:30 +00:00
|
|
|
|
2008-02-16 19:36:07 +00:00
|
|
|
/* #define TEST_RTL */
|
|
|
|
|
2007-12-19 02:46:30 +00:00
|
|
|
/***
|
|
|
|
****
|
|
|
|
***/
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
|
2021-12-14 08:43:27 +00:00
|
|
|
auto const DefaultBarHeight = 12;
|
|
|
|
auto const CompactBarWidth = 50;
|
|
|
|
auto const SmallScale = 0.9;
|
2022-10-08 22:50:03 +00:00
|
|
|
auto const CompactIconSize = IF_GTKMM4(Gtk::IconSize::NORMAL, Gtk::ICON_SIZE_MENU);
|
|
|
|
auto const FullIconSize = IF_GTKMM4(Gtk::IconSize::LARGE, Gtk::ICON_SIZE_DND);
|
2021-12-14 08:43:27 +00:00
|
|
|
|
2022-11-13 17:36:16 +00:00
|
|
|
auto get_height(Gtk::Requisition const& req)
|
|
|
|
{
|
|
|
|
return req.IF_GTKMM4(get_height(), height);
|
|
|
|
}
|
|
|
|
|
|
|
|
auto get_width(Gtk::Requisition const& req)
|
|
|
|
{
|
|
|
|
return req.IF_GTKMM4(get_width(), width);
|
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
} // namespace
|
|
|
|
|
2007-12-19 02:46:30 +00:00
|
|
|
/***
|
|
|
|
****
|
|
|
|
***/
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
class TorrentCellRenderer::Impl
|
2007-12-19 02:46:30 +00:00
|
|
|
{
|
2022-10-18 23:17:54 +00:00
|
|
|
using SnapshotPtr = TorrentCellRenderer::SnapshotPtr;
|
2022-10-08 22:50:03 +00:00
|
|
|
using IconSize = IF_GTKMM4(Gtk::IconSize, Gtk::BuiltinIconSize);
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
public:
|
2021-12-14 08:43:27 +00:00
|
|
|
explicit Impl(TorrentCellRenderer& renderer);
|
2021-10-18 20:22:31 +00:00
|
|
|
~Impl();
|
|
|
|
|
2021-12-14 08:43:27 +00:00
|
|
|
TR_DISABLE_COPY_MOVE(Impl)
|
|
|
|
|
2022-11-15 19:30:32 +00:00
|
|
|
Gtk::Requisition get_size_compact(Gtk::Widget& widget) const;
|
|
|
|
Gtk::Requisition get_size_full(Gtk::Widget& widget) const;
|
2021-10-18 20:22:31 +00:00
|
|
|
|
|
|
|
void render_compact(
|
2022-10-18 23:17:54 +00:00
|
|
|
SnapshotPtr const& snapshot,
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::Widget& widget,
|
|
|
|
Gdk::Rectangle const& background_area,
|
|
|
|
Gtk::CellRendererState flags);
|
|
|
|
void render_full(
|
2022-10-18 23:17:54 +00:00
|
|
|
SnapshotPtr const& snapshot,
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::Widget& widget,
|
|
|
|
Gdk::Rectangle const& background_area,
|
|
|
|
Gtk::CellRendererState flags);
|
|
|
|
|
2022-11-13 17:36:16 +00:00
|
|
|
auto& property_torrent()
|
|
|
|
{
|
|
|
|
return property_torrent_;
|
|
|
|
}
|
2009-08-07 20:49:06 +00:00
|
|
|
|
2022-11-13 17:36:16 +00:00
|
|
|
auto& property_bar_height()
|
|
|
|
{
|
|
|
|
return property_bar_height_;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto& property_compact()
|
|
|
|
{
|
|
|
|
return property_compact_;
|
|
|
|
}
|
2009-08-07 20:49:06 +00:00
|
|
|
|
2022-10-08 22:50:03 +00:00
|
|
|
private:
|
2022-10-18 23:17:54 +00:00
|
|
|
void render_progress_bar(
|
|
|
|
SnapshotPtr const& snapshot,
|
|
|
|
Gtk::Widget& widget,
|
|
|
|
Gdk::Rectangle const& area,
|
|
|
|
Gtk::CellRendererState flags,
|
|
|
|
Gdk::RGBA const& color);
|
|
|
|
|
2022-10-08 22:50:03 +00:00
|
|
|
static void set_icon(Gtk::CellRendererPixbuf& renderer, Glib::RefPtr<Gio::Icon> const& icon, IconSize icon_size);
|
2022-10-18 23:17:54 +00:00
|
|
|
static void adjust_progress_bar_hue(
|
|
|
|
Cairo::RefPtr<Cairo::Surface> const& bg_surface,
|
|
|
|
Cairo::RefPtr<Cairo::Context> const& context,
|
|
|
|
Gdk::RGBA const& color,
|
|
|
|
Gdk::Rectangle const& area,
|
|
|
|
double bg_x,
|
|
|
|
double bg_y);
|
2022-10-08 22:50:03 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
private:
|
|
|
|
TorrentCellRenderer& renderer_;
|
|
|
|
|
2022-12-21 21:26:25 +00:00
|
|
|
Glib::Property<Torrent*> property_torrent_;
|
2022-11-13 17:36:16 +00:00
|
|
|
Glib::Property<int> property_bar_height_;
|
|
|
|
Glib::Property<bool> property_compact_;
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::CellRendererText* text_renderer_ = nullptr;
|
|
|
|
Gtk::CellRendererProgress* progress_renderer_ = nullptr;
|
|
|
|
Gtk::CellRendererPixbuf* icon_renderer_ = nullptr;
|
|
|
|
};
|
2007-12-19 02:46:30 +00:00
|
|
|
|
2009-03-02 23:31:01 +00:00
|
|
|
/***
|
|
|
|
****
|
|
|
|
***/
|
|
|
|
|
2022-10-08 22:50:03 +00:00
|
|
|
void TorrentCellRenderer::Impl::set_icon(
|
|
|
|
Gtk::CellRendererPixbuf& renderer,
|
|
|
|
Glib::RefPtr<Gio::Icon> const& icon,
|
|
|
|
IconSize icon_size)
|
|
|
|
{
|
|
|
|
renderer.property_gicon() = icon;
|
|
|
|
#if GTKMM_CHECK_VERSION(4, 0, 0)
|
|
|
|
renderer.property_icon_size() = icon_size;
|
|
|
|
#else
|
|
|
|
renderer.property_stock_size() = icon_size;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2022-11-15 19:30:32 +00:00
|
|
|
Gtk::Requisition TorrentCellRenderer::Impl::get_size_compact(Gtk::Widget& widget) const
|
2009-03-02 23:31:01 +00:00
|
|
|
{
|
2022-11-13 17:36:16 +00:00
|
|
|
int xpad = 0;
|
|
|
|
int ypad = 0;
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::Requisition min_size;
|
|
|
|
Gtk::Requisition icon_size;
|
|
|
|
Gtk::Requisition name_size;
|
|
|
|
Gtk::Requisition stat_size;
|
|
|
|
|
2022-12-21 21:26:25 +00:00
|
|
|
auto const& torrent = *property_torrent_.get_value();
|
2021-10-18 20:22:31 +00:00
|
|
|
|
2022-12-21 21:26:25 +00:00
|
|
|
auto const icon = torrent.get_icon();
|
|
|
|
auto const name = torrent.get_name();
|
|
|
|
auto const gstr_stat = torrent.get_short_status_text();
|
2021-10-18 20:22:31 +00:00
|
|
|
renderer_.get_padding(xpad, ypad);
|
2009-03-02 23:31:01 +00:00
|
|
|
|
|
|
|
/* get the idealized cell dimensions */
|
2022-10-08 22:50:03 +00:00
|
|
|
set_icon(*icon_renderer_, icon, CompactIconSize);
|
2021-10-18 20:22:31 +00:00
|
|
|
icon_renderer_->get_preferred_size(widget, min_size, icon_size);
|
|
|
|
text_renderer_->property_text() = name;
|
2022-09-10 13:19:54 +00:00
|
|
|
text_renderer_->property_ellipsize() = TR_PANGO_ELLIPSIZE_MODE(NONE);
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->property_scale() = 1.0;
|
|
|
|
text_renderer_->get_preferred_size(widget, min_size, name_size);
|
|
|
|
text_renderer_->property_text() = gstr_stat;
|
2021-12-14 08:43:27 +00:00
|
|
|
text_renderer_->property_scale() = SmallScale;
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->get_preferred_size(widget, min_size, stat_size);
|
2009-08-10 20:04:08 +00:00
|
|
|
|
2009-03-02 23:31:01 +00:00
|
|
|
/**
|
|
|
|
*** LAYOUT
|
|
|
|
**/
|
|
|
|
|
2022-11-15 19:30:32 +00:00
|
|
|
return { xpad * 2 + get_width(icon_size) + GUI_PAD + CompactBarWidth + GUI_PAD + get_width(stat_size),
|
|
|
|
ypad * 2 + std::max(get_height(name_size), property_bar_height_.get_value()) };
|
2009-03-02 23:31:01 +00:00
|
|
|
}
|
|
|
|
|
2022-11-15 19:30:32 +00:00
|
|
|
Gtk::Requisition TorrentCellRenderer::Impl::get_size_full(Gtk::Widget& widget) const
|
2009-03-02 23:31:01 +00:00
|
|
|
{
|
2022-11-13 17:36:16 +00:00
|
|
|
int xpad = 0;
|
|
|
|
int ypad = 0;
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::Requisition min_size;
|
|
|
|
Gtk::Requisition icon_size;
|
|
|
|
Gtk::Requisition name_size;
|
|
|
|
Gtk::Requisition stat_size;
|
|
|
|
Gtk::Requisition prog_size;
|
|
|
|
|
2022-12-21 21:26:25 +00:00
|
|
|
auto const& torrent = *property_torrent_.get_value();
|
|
|
|
|
|
|
|
auto const icon = torrent.get_icon();
|
|
|
|
auto const name = torrent.get_name();
|
|
|
|
auto const gstr_stat = torrent.get_long_status_text();
|
|
|
|
auto const gstr_prog = torrent.get_long_progress_text();
|
2021-10-18 20:22:31 +00:00
|
|
|
renderer_.get_padding(xpad, ypad);
|
2009-03-02 23:31:01 +00:00
|
|
|
|
|
|
|
/* get the idealized cell dimensions */
|
2022-10-08 22:50:03 +00:00
|
|
|
set_icon(*icon_renderer_, icon, FullIconSize);
|
2021-10-18 20:22:31 +00:00
|
|
|
icon_renderer_->get_preferred_size(widget, min_size, icon_size);
|
|
|
|
text_renderer_->property_text() = name;
|
2022-09-10 13:19:54 +00:00
|
|
|
text_renderer_->property_weight() = TR_PANGO_WEIGHT(BOLD);
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->property_scale() = 1.0;
|
2022-09-10 13:19:54 +00:00
|
|
|
text_renderer_->property_ellipsize() = TR_PANGO_ELLIPSIZE_MODE(NONE);
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->get_preferred_size(widget, min_size, name_size);
|
|
|
|
text_renderer_->property_text() = gstr_prog;
|
2022-09-10 13:19:54 +00:00
|
|
|
text_renderer_->property_weight() = TR_PANGO_WEIGHT(NORMAL);
|
2021-12-14 08:43:27 +00:00
|
|
|
text_renderer_->property_scale() = SmallScale;
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->get_preferred_size(widget, min_size, prog_size);
|
|
|
|
text_renderer_->property_text() = gstr_stat;
|
|
|
|
text_renderer_->get_preferred_size(widget, min_size, stat_size);
|
2009-08-10 20:04:08 +00:00
|
|
|
|
2009-03-02 23:31:01 +00:00
|
|
|
/**
|
|
|
|
*** LAYOUT
|
|
|
|
**/
|
|
|
|
|
2022-11-15 19:30:32 +00:00
|
|
|
return { xpad * 2 + get_width(icon_size) + GUI_PAD + std::max(get_width(prog_size), get_width(stat_size)),
|
|
|
|
ypad * 2 + get_height(name_size) + get_height(prog_size) + GUI_PAD_SMALL + property_bar_height_.get_value() +
|
|
|
|
GUI_PAD_SMALL + get_height(stat_size) };
|
2009-03-02 23:31:01 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void TorrentCellRenderer::get_preferred_width_vfunc(Gtk::Widget& widget, int& minimum_width, int& natural_width) const
|
2007-12-19 02:46:30 +00:00
|
|
|
{
|
2022-11-13 17:36:16 +00:00
|
|
|
if (impl_->property_torrent().get_value() != nullptr)
|
2007-12-19 02:46:30 +00:00
|
|
|
{
|
2022-11-15 19:30:32 +00:00
|
|
|
auto const size = impl_->property_compact().get_value() ? impl_->get_size_compact(widget) :
|
|
|
|
impl_->get_size_full(widget);
|
2007-12-19 20:04:38 +00:00
|
|
|
|
2022-11-15 19:30:32 +00:00
|
|
|
minimum_width = get_width(size);
|
|
|
|
natural_width = minimum_width;
|
2021-10-18 20:22:31 +00:00
|
|
|
}
|
|
|
|
}
|
2007-12-19 02:46:30 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void TorrentCellRenderer::get_preferred_height_vfunc(Gtk::Widget& widget, int& minimum_height, int& natural_height) const
|
|
|
|
{
|
2022-11-13 17:36:16 +00:00
|
|
|
if (impl_->property_torrent().get_value() != nullptr)
|
2021-10-18 20:22:31 +00:00
|
|
|
{
|
2022-11-15 19:30:32 +00:00
|
|
|
auto const size = impl_->property_compact().get_value() ? impl_->get_size_compact(widget) :
|
|
|
|
impl_->get_size_full(widget);
|
2021-10-18 20:22:31 +00:00
|
|
|
|
2022-11-15 19:30:32 +00:00
|
|
|
minimum_height = get_height(size);
|
|
|
|
natural_height = minimum_height;
|
2007-12-19 02:46:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
namespace
|
|
|
|
{
|
2011-07-26 01:02:32 +00:00
|
|
|
|
2022-12-21 21:26:25 +00:00
|
|
|
Gdk::RGBA const& get_progress_bar_color(Torrent const& torrent)
|
2022-10-18 23:17:54 +00:00
|
|
|
{
|
|
|
|
static auto const steelblue_color = Gdk::RGBA("steelblue");
|
|
|
|
static auto const forestgreen_color = Gdk::RGBA("forestgreen");
|
|
|
|
static auto const silver_color = Gdk::RGBA("silver");
|
|
|
|
|
2022-12-21 21:26:25 +00:00
|
|
|
switch (torrent.get_activity())
|
|
|
|
{
|
|
|
|
case TR_STATUS_DOWNLOAD:
|
|
|
|
return steelblue_color;
|
|
|
|
case TR_STATUS_SEED:
|
|
|
|
return forestgreen_color;
|
|
|
|
default:
|
|
|
|
return silver_color;
|
|
|
|
}
|
2022-10-18 23:17:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Cairo::RefPtr<Cairo::Surface> get_mask_surface(Cairo::RefPtr<Cairo::Surface> const& surface, Gdk::Rectangle const& area)
|
|
|
|
{
|
|
|
|
auto const mask_surface = Cairo::ImageSurface::create(TR_CAIRO_SURFACE_FORMAT(A8), area.get_width(), area.get_height());
|
|
|
|
auto const mask_context = Cairo::Context::create(mask_surface);
|
|
|
|
|
|
|
|
mask_context->set_source_rgb(0, 0, 0);
|
|
|
|
mask_context->rectangle(area.get_x(), area.get_y(), area.get_width(), area.get_height());
|
|
|
|
mask_context->fill();
|
|
|
|
|
|
|
|
mask_context->set_operator(TR_CAIRO_CONTEXT_OPERATOR(CLEAR));
|
|
|
|
mask_context->mask(surface, area.get_x(), area.get_y());
|
|
|
|
mask_context->fill();
|
|
|
|
|
|
|
|
return mask_surface;
|
|
|
|
}
|
|
|
|
|
2022-10-08 22:50:03 +00:00
|
|
|
template<typename... Ts>
|
|
|
|
void render_impl(Gtk::CellRenderer& renderer, Ts&&... args)
|
|
|
|
{
|
|
|
|
renderer.IF_GTKMM4(snapshot, render)(std::forward<Ts>(args)...);
|
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
} // namespace
|
2011-07-26 01:02:32 +00:00
|
|
|
|
2022-10-18 23:17:54 +00:00
|
|
|
void TorrentCellRenderer::Impl::adjust_progress_bar_hue(
|
|
|
|
Cairo::RefPtr<Cairo::Surface> const& bg_surface,
|
|
|
|
Cairo::RefPtr<Cairo::Context> const& context,
|
|
|
|
Gdk::RGBA const& color,
|
|
|
|
Gdk::Rectangle const& area,
|
|
|
|
double bg_x,
|
|
|
|
double bg_y)
|
|
|
|
{
|
|
|
|
using TrCairoContextOperator = IF_GTKMM4(Cairo::Context::Operator, Cairo::Operator);
|
|
|
|
|
|
|
|
auto const mask_surface = get_mask_surface(context->get_target(), area);
|
|
|
|
|
|
|
|
// Add background under the progress bar, for better results around the transparent areas
|
|
|
|
context->set_source(bg_surface, bg_x, bg_y);
|
|
|
|
context->set_operator(TR_CAIRO_CONTEXT_OPERATOR(DEST_OVER));
|
|
|
|
context->rectangle(area.get_x(), area.get_y(), area.get_width(), area.get_height());
|
|
|
|
context->fill();
|
|
|
|
|
|
|
|
// Adjust surface color
|
|
|
|
context->set_source_rgb(color.get_red(), color.get_green(), color.get_blue());
|
|
|
|
context->set_operator(static_cast<TrCairoContextOperator>(CAIRO_OPERATOR_HSL_COLOR));
|
|
|
|
context->rectangle(area.get_x(), area.get_y(), area.get_width(), area.get_height());
|
|
|
|
context->fill();
|
|
|
|
|
|
|
|
// Clear out masked (fully transparent) areas
|
|
|
|
context->set_operator(TR_CAIRO_CONTEXT_OPERATOR(CLEAR));
|
|
|
|
context->mask(mask_surface, area.get_x(), area.get_y());
|
|
|
|
context->fill();
|
|
|
|
}
|
|
|
|
|
|
|
|
void TorrentCellRenderer::Impl::render_progress_bar(
|
|
|
|
SnapshotPtr const& snapshot,
|
|
|
|
Gtk::Widget& widget,
|
|
|
|
Gdk::Rectangle const& area,
|
|
|
|
Gtk::CellRendererState flags,
|
|
|
|
Gdk::RGBA const& color)
|
|
|
|
{
|
|
|
|
auto const temp_area = Gdk::Rectangle(0, 0, area.get_width(), area.get_height());
|
|
|
|
auto const temp_surface = Cairo::ImageSurface::create(TR_CAIRO_SURFACE_FORMAT(ARGB32), area.get_width(), area.get_height());
|
|
|
|
auto const temp_context = Cairo::Context::create(temp_surface);
|
|
|
|
|
|
|
|
{
|
|
|
|
#if GTKMM_CHECK_VERSION(4, 0, 0)
|
|
|
|
auto const temp_snapshot = Gtk::Snapshot::create();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
render_impl(*progress_renderer_, IF_GTKMM4(temp_snapshot, temp_context), widget, temp_area, temp_area, flags);
|
|
|
|
|
|
|
|
#if GTKMM_CHECK_VERSION(4, 0, 0)
|
|
|
|
temp_snapshot->reference();
|
|
|
|
auto const render_node = std::unique_ptr<GskRenderNode, void (*)(GskRenderNode*)>(
|
|
|
|
gtk_snapshot_free_to_node(Glib::unwrap(temp_snapshot)),
|
|
|
|
[](GskRenderNode* p) { gsk_render_node_unref(p); });
|
|
|
|
gsk_render_node_draw(render_node.get(), temp_context->cobj());
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
#if GTKMM_CHECK_VERSION(4, 0, 0)
|
|
|
|
auto const context = snapshot->append_cairo(area);
|
|
|
|
auto const surface = context->get_target();
|
|
|
|
#else
|
|
|
|
auto const context = snapshot;
|
|
|
|
auto const surface = Cairo::Surface::create(
|
|
|
|
context->get_target(),
|
|
|
|
area.get_x(),
|
|
|
|
area.get_y(),
|
|
|
|
area.get_width(),
|
|
|
|
area.get_height());
|
|
|
|
#endif
|
|
|
|
|
2022-11-09 16:58:36 +00:00
|
|
|
double dx = 0;
|
|
|
|
double dy = 0;
|
2022-10-18 23:17:54 +00:00
|
|
|
context->device_to_user(dx, dy);
|
|
|
|
|
|
|
|
adjust_progress_bar_hue(surface, temp_context, color, temp_area, dx - area.get_x(), dy - area.get_y());
|
|
|
|
|
|
|
|
context->set_source(temp_context->get_target(), area.get_x(), area.get_y());
|
|
|
|
context->rectangle(area.get_x(), area.get_y(), area.get_width(), area.get_height());
|
|
|
|
context->fill();
|
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void TorrentCellRenderer::Impl::render_compact(
|
2022-10-18 23:17:54 +00:00
|
|
|
SnapshotPtr const& snapshot,
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::Widget& widget,
|
|
|
|
Gdk::Rectangle const& background_area,
|
|
|
|
Gtk::CellRendererState flags)
|
2011-07-26 01:02:32 +00:00
|
|
|
{
|
2022-11-13 17:36:16 +00:00
|
|
|
int xpad = 0;
|
|
|
|
int ypad = 0;
|
|
|
|
int min_width = 0;
|
|
|
|
int width = 0;
|
2009-03-02 23:31:01 +00:00
|
|
|
|
2022-12-21 21:26:25 +00:00
|
|
|
auto const& torrent = *property_torrent_.get_value();
|
|
|
|
auto const percent_done = static_cast<int>(torrent.get_percent_done() * 100);
|
|
|
|
bool const sensitive = torrent.get_sensitive();
|
2021-10-18 20:22:31 +00:00
|
|
|
|
2022-12-21 21:26:25 +00:00
|
|
|
if (torrent.get_error_code() != 0 && (flags & TR_GTK_CELL_RENDERER_STATE(SELECTED)) == Gtk::CellRendererState{})
|
2022-10-08 22:50:03 +00:00
|
|
|
{
|
|
|
|
text_renderer_->property_foreground() = "red";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
text_renderer_->property_foreground_set() = false;
|
|
|
|
}
|
|
|
|
|
2022-12-21 21:26:25 +00:00
|
|
|
auto const icon = torrent.get_icon();
|
|
|
|
auto const name = torrent.get_name();
|
|
|
|
auto const& progress_color = get_progress_bar_color(torrent);
|
|
|
|
auto const gstr_stat = torrent.get_short_status_text();
|
2021-10-18 20:22:31 +00:00
|
|
|
renderer_.get_padding(xpad, ypad);
|
|
|
|
|
|
|
|
auto fill_area = background_area;
|
|
|
|
fill_area.set_x(fill_area.get_x() + xpad);
|
|
|
|
fill_area.set_y(fill_area.get_y() + ypad);
|
|
|
|
fill_area.set_width(fill_area.get_width() - xpad * 2);
|
|
|
|
fill_area.set_height(fill_area.get_height() - ypad * 2);
|
|
|
|
|
|
|
|
auto icon_area = fill_area;
|
2022-10-08 22:50:03 +00:00
|
|
|
set_icon(*icon_renderer_, icon, CompactIconSize);
|
2021-10-18 20:22:31 +00:00
|
|
|
icon_renderer_->get_preferred_width(widget, min_width, width);
|
|
|
|
icon_area.set_width(width);
|
2021-11-15 16:32:41 +00:00
|
|
|
|
|
|
|
auto prog_area = fill_area;
|
2021-12-14 08:43:27 +00:00
|
|
|
prog_area.set_width(CompactBarWidth);
|
2021-11-15 16:32:41 +00:00
|
|
|
|
|
|
|
auto stat_area = fill_area;
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->property_text() = gstr_stat;
|
2022-09-10 13:19:54 +00:00
|
|
|
text_renderer_->property_ellipsize() = TR_PANGO_ELLIPSIZE_MODE(NONE);
|
2021-12-14 08:43:27 +00:00
|
|
|
text_renderer_->property_scale() = SmallScale;
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->get_preferred_width(widget, min_width, width);
|
|
|
|
stat_area.set_width(width);
|
|
|
|
|
2021-11-15 16:32:41 +00:00
|
|
|
auto name_area = fill_area;
|
|
|
|
name_area.set_width(
|
|
|
|
fill_area.get_width() - icon_area.get_width() - stat_area.get_width() - prog_area.get_width() - GUI_PAD * 3);
|
|
|
|
|
2022-09-10 13:19:54 +00:00
|
|
|
if ((renderer_.get_state(widget, flags) & TR_GTK_STATE_FLAGS(DIR_RTL)) == Gtk::StateFlags{})
|
2021-11-15 16:32:41 +00:00
|
|
|
{
|
|
|
|
icon_area.set_x(fill_area.get_x());
|
|
|
|
prog_area.set_x(fill_area.get_x() + fill_area.get_width() - prog_area.get_width());
|
|
|
|
stat_area.set_x(prog_area.get_x() - stat_area.get_width() - GUI_PAD);
|
|
|
|
name_area.set_x(icon_area.get_x() + icon_area.get_width() + GUI_PAD);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
icon_area.set_x(fill_area.get_x() + fill_area.get_width() - icon_area.get_width());
|
|
|
|
prog_area.set_x(fill_area.get_x());
|
|
|
|
stat_area.set_x(prog_area.get_x() + prog_area.get_width() + GUI_PAD);
|
|
|
|
name_area.set_x(stat_area.get_x() + stat_area.get_width() + GUI_PAD);
|
|
|
|
}
|
2009-03-02 23:31:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
*** RENDER
|
|
|
|
**/
|
2009-08-10 20:04:08 +00:00
|
|
|
|
2022-10-08 22:50:03 +00:00
|
|
|
set_icon(*icon_renderer_, icon, CompactIconSize);
|
2021-10-18 20:22:31 +00:00
|
|
|
icon_renderer_->property_sensitive() = sensitive;
|
2022-10-18 23:17:54 +00:00
|
|
|
render_impl(*icon_renderer_, snapshot, widget, icon_area, icon_area, flags);
|
2021-11-15 16:32:41 +00:00
|
|
|
|
2022-04-01 16:29:05 +00:00
|
|
|
progress_renderer_->property_value() = percent_done;
|
|
|
|
progress_renderer_->property_text() = fmt::format(FMT_STRING("{:d}%"), percent_done);
|
2021-10-18 20:22:31 +00:00
|
|
|
progress_renderer_->property_sensitive() = sensitive;
|
2022-10-18 23:17:54 +00:00
|
|
|
render_progress_bar(snapshot, widget, prog_area, flags, progress_color);
|
2021-11-15 16:32:41 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->property_text() = gstr_stat;
|
2021-12-14 08:43:27 +00:00
|
|
|
text_renderer_->property_scale() = SmallScale;
|
2022-09-10 13:19:54 +00:00
|
|
|
text_renderer_->property_ellipsize() = TR_PANGO_ELLIPSIZE_MODE(END);
|
2022-12-21 21:26:25 +00:00
|
|
|
text_renderer_->property_sensitive() = sensitive;
|
2022-10-18 23:17:54 +00:00
|
|
|
render_impl(*text_renderer_, snapshot, widget, stat_area, stat_area, flags);
|
2021-11-15 16:32:41 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->property_text() = name;
|
|
|
|
text_renderer_->property_scale() = 1.0;
|
2022-10-18 23:17:54 +00:00
|
|
|
render_impl(*text_renderer_, snapshot, widget, name_area, name_area, flags);
|
2009-03-02 23:31:01 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void TorrentCellRenderer::Impl::render_full(
|
2022-10-18 23:17:54 +00:00
|
|
|
SnapshotPtr const& snapshot,
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::Widget& widget,
|
|
|
|
Gdk::Rectangle const& background_area,
|
|
|
|
Gtk::CellRendererState flags)
|
2009-03-02 23:31:01 +00:00
|
|
|
{
|
2022-11-13 17:36:16 +00:00
|
|
|
int xpad = 0;
|
|
|
|
int ypad = 0;
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::Requisition min_size;
|
|
|
|
Gtk::Requisition size;
|
2009-03-02 23:31:01 +00:00
|
|
|
|
2022-12-21 21:26:25 +00:00
|
|
|
auto const& torrent = *property_torrent_.get_value();
|
|
|
|
auto const percent_done = static_cast<int>(torrent.get_percent_done() * 100);
|
|
|
|
bool const sensitive = torrent.get_sensitive();
|
2021-10-18 20:22:31 +00:00
|
|
|
|
2022-12-21 21:26:25 +00:00
|
|
|
if (torrent.get_error_code() != 0 && (flags & TR_GTK_CELL_RENDERER_STATE(SELECTED)) == Gtk::CellRendererState{})
|
2022-10-08 22:50:03 +00:00
|
|
|
{
|
|
|
|
text_renderer_->property_foreground() = "red";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
text_renderer_->property_foreground_set() = false;
|
|
|
|
}
|
|
|
|
|
2022-12-21 21:26:25 +00:00
|
|
|
auto const icon = torrent.get_icon();
|
|
|
|
auto const name = torrent.get_name();
|
|
|
|
auto const& progress_color = get_progress_bar_color(torrent);
|
|
|
|
auto const gstr_prog = torrent.get_long_progress_text();
|
|
|
|
auto const gstr_stat = torrent.get_long_status_text();
|
2021-10-18 20:22:31 +00:00
|
|
|
renderer_.get_padding(xpad, ypad);
|
2009-03-02 23:31:01 +00:00
|
|
|
|
|
|
|
/* get the idealized cell dimensions */
|
2021-11-15 16:32:41 +00:00
|
|
|
Gdk::Rectangle icon_area;
|
2022-10-08 22:50:03 +00:00
|
|
|
set_icon(*icon_renderer_, icon, FullIconSize);
|
2021-10-18 20:22:31 +00:00
|
|
|
icon_renderer_->get_preferred_size(widget, min_size, size);
|
2022-11-13 17:36:16 +00:00
|
|
|
icon_area.set_width(get_width(size));
|
|
|
|
icon_area.set_height(get_height(size));
|
2021-11-15 16:32:41 +00:00
|
|
|
|
|
|
|
Gdk::Rectangle name_area;
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->property_text() = name;
|
2022-09-10 13:19:54 +00:00
|
|
|
text_renderer_->property_weight() = TR_PANGO_WEIGHT(BOLD);
|
|
|
|
text_renderer_->property_ellipsize() = TR_PANGO_ELLIPSIZE_MODE(NONE);
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->property_scale() = 1.0;
|
|
|
|
text_renderer_->get_preferred_size(widget, min_size, size);
|
2022-11-13 17:36:16 +00:00
|
|
|
name_area.set_height(get_height(size));
|
2021-11-15 16:32:41 +00:00
|
|
|
|
|
|
|
Gdk::Rectangle prog_area;
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->property_text() = gstr_prog;
|
2022-09-10 13:19:54 +00:00
|
|
|
text_renderer_->property_weight() = TR_PANGO_WEIGHT(NORMAL);
|
2021-12-14 08:43:27 +00:00
|
|
|
text_renderer_->property_scale() = SmallScale;
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->get_preferred_size(widget, min_size, size);
|
2022-11-13 17:36:16 +00:00
|
|
|
prog_area.set_height(get_height(size));
|
2021-11-15 16:32:41 +00:00
|
|
|
|
|
|
|
Gdk::Rectangle stat_area;
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->property_text() = gstr_stat;
|
|
|
|
text_renderer_->get_preferred_size(widget, min_size, size);
|
2022-11-13 17:36:16 +00:00
|
|
|
stat_area.set_height(get_height(size));
|
2009-08-10 20:04:08 +00:00
|
|
|
|
2021-11-15 16:32:41 +00:00
|
|
|
Gdk::Rectangle prct_area;
|
|
|
|
|
2009-03-02 23:31:01 +00:00
|
|
|
/**
|
|
|
|
*** LAYOUT
|
|
|
|
**/
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
auto fill_area = background_area;
|
|
|
|
fill_area.set_x(fill_area.get_x() + xpad);
|
|
|
|
fill_area.set_y(fill_area.get_y() + ypad);
|
|
|
|
fill_area.set_width(fill_area.get_width() - xpad * 2);
|
|
|
|
fill_area.set_height(fill_area.get_height() - ypad * 2);
|
2009-03-02 23:31:01 +00:00
|
|
|
|
|
|
|
/* icon */
|
2021-10-18 20:22:31 +00:00
|
|
|
icon_area.set_y(fill_area.get_y() + (fill_area.get_height() - icon_area.get_height()) / 2);
|
2009-03-02 23:31:01 +00:00
|
|
|
|
|
|
|
/* name */
|
2021-10-18 20:22:31 +00:00
|
|
|
name_area.set_y(fill_area.get_y());
|
2021-11-15 16:32:41 +00:00
|
|
|
name_area.set_width(fill_area.get_width() - GUI_PAD - icon_area.get_width());
|
|
|
|
|
2022-09-10 13:19:54 +00:00
|
|
|
if ((renderer_.get_state(widget, flags) & TR_GTK_STATE_FLAGS(DIR_RTL)) == Gtk::StateFlags{})
|
2021-11-15 16:32:41 +00:00
|
|
|
{
|
|
|
|
icon_area.set_x(fill_area.get_x());
|
|
|
|
name_area.set_x(fill_area.get_x() + fill_area.get_width() - name_area.get_width());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
icon_area.set_x(fill_area.get_x() + fill_area.get_width() - icon_area.get_width());
|
|
|
|
name_area.set_x(fill_area.get_x());
|
|
|
|
}
|
2009-03-02 23:31:01 +00:00
|
|
|
|
|
|
|
/* prog */
|
2021-10-18 20:22:31 +00:00
|
|
|
prog_area.set_x(name_area.get_x());
|
|
|
|
prog_area.set_y(name_area.get_y() + name_area.get_height());
|
|
|
|
prog_area.set_width(name_area.get_width());
|
2009-03-02 23:31:01 +00:00
|
|
|
|
|
|
|
/* progressbar */
|
2021-10-18 20:22:31 +00:00
|
|
|
prct_area.set_x(prog_area.get_x());
|
|
|
|
prct_area.set_y(prog_area.get_y() + prog_area.get_height() + GUI_PAD_SMALL);
|
|
|
|
prct_area.set_width(prog_area.get_width());
|
2022-11-13 17:36:16 +00:00
|
|
|
prct_area.set_height(property_bar_height_.get_value());
|
2009-03-02 23:31:01 +00:00
|
|
|
|
|
|
|
/* status */
|
2021-10-18 20:22:31 +00:00
|
|
|
stat_area.set_x(prct_area.get_x());
|
|
|
|
stat_area.set_y(prct_area.get_y() + prct_area.get_height() + GUI_PAD_SMALL);
|
|
|
|
stat_area.set_width(prct_area.get_width());
|
2009-03-02 23:31:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
*** RENDER
|
|
|
|
**/
|
2009-08-10 20:04:08 +00:00
|
|
|
|
2022-10-08 22:50:03 +00:00
|
|
|
set_icon(*icon_renderer_, icon, FullIconSize);
|
2021-10-18 20:22:31 +00:00
|
|
|
icon_renderer_->property_sensitive() = sensitive;
|
2022-10-18 23:17:54 +00:00
|
|
|
render_impl(*icon_renderer_, snapshot, widget, icon_area, icon_area, flags);
|
2021-11-15 16:32:41 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->property_text() = name;
|
|
|
|
text_renderer_->property_scale() = 1.0;
|
2022-09-10 13:19:54 +00:00
|
|
|
text_renderer_->property_ellipsize() = TR_PANGO_ELLIPSIZE_MODE(END);
|
|
|
|
text_renderer_->property_weight() = TR_PANGO_WEIGHT(BOLD);
|
2022-12-21 21:26:25 +00:00
|
|
|
text_renderer_->property_sensitive() = sensitive;
|
2022-10-18 23:17:54 +00:00
|
|
|
render_impl(*text_renderer_, snapshot, widget, name_area, name_area, flags);
|
2021-11-15 16:32:41 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->property_text() = gstr_prog;
|
2021-12-14 08:43:27 +00:00
|
|
|
text_renderer_->property_scale() = SmallScale;
|
2022-09-10 13:19:54 +00:00
|
|
|
text_renderer_->property_weight() = TR_PANGO_WEIGHT(NORMAL);
|
2022-10-18 23:17:54 +00:00
|
|
|
render_impl(*text_renderer_, snapshot, widget, prog_area, prog_area, flags);
|
2021-11-15 16:32:41 +00:00
|
|
|
|
2022-11-13 17:36:16 +00:00
|
|
|
progress_renderer_->property_value() = percent_done;
|
2021-10-18 20:22:31 +00:00
|
|
|
progress_renderer_->property_text() = Glib::ustring();
|
|
|
|
progress_renderer_->property_sensitive() = sensitive;
|
2022-10-18 23:17:54 +00:00
|
|
|
render_progress_bar(snapshot, widget, prct_area, flags, progress_color);
|
2021-11-15 16:32:41 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->property_text() = gstr_stat;
|
2022-10-18 23:17:54 +00:00
|
|
|
render_impl(*text_renderer_, snapshot, widget, stat_area, stat_area, flags);
|
2009-03-02 23:31:01 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 22:50:03 +00:00
|
|
|
void TorrentCellRenderer::IF_GTKMM4(snapshot_vfunc, render_vfunc)(
|
2022-10-18 23:17:54 +00:00
|
|
|
SnapshotPtr const& snapshot,
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::Widget& widget,
|
|
|
|
Gdk::Rectangle const& background_area,
|
|
|
|
Gdk::Rectangle const& /*cell_area*/,
|
|
|
|
Gtk::CellRendererState flags)
|
2007-12-19 02:46:30 +00:00
|
|
|
{
|
2008-02-16 19:36:07 +00:00
|
|
|
#ifdef TEST_RTL
|
2021-10-18 20:22:31 +00:00
|
|
|
auto const real_dir = widget.get_direction();
|
|
|
|
widget.set_direction(Gtk::TEXT_DIR_RTL);
|
2008-02-16 19:36:07 +00:00
|
|
|
#endif
|
|
|
|
|
2022-11-13 17:36:16 +00:00
|
|
|
if (impl_->property_torrent().get_value() != nullptr)
|
2007-12-19 02:46:30 +00:00
|
|
|
{
|
2022-11-13 17:36:16 +00:00
|
|
|
if (impl_->property_compact().get_value())
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2022-10-18 23:17:54 +00:00
|
|
|
impl_->render_compact(snapshot, widget, background_area, flags);
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
2007-12-19 20:04:38 +00:00
|
|
|
else
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2022-10-18 23:17:54 +00:00
|
|
|
impl_->render_full(snapshot, widget, background_area, flags);
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
2007-12-19 02:46:30 +00:00
|
|
|
}
|
2008-02-16 19:36:07 +00:00
|
|
|
|
|
|
|
#ifdef TEST_RTL
|
2021-10-18 20:22:31 +00:00
|
|
|
widget.set_direction(real_dir);
|
2008-02-16 19:36:07 +00:00
|
|
|
#endif
|
2007-12-19 02:46:30 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
TorrentCellRenderer::Impl::~Impl()
|
2007-12-19 02:46:30 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->unreference();
|
|
|
|
progress_renderer_->unreference();
|
|
|
|
icon_renderer_->unreference();
|
2007-12-19 02:46:30 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
TorrentCellRenderer::TorrentCellRenderer()
|
|
|
|
: Glib::ObjectBase(typeid(TorrentCellRenderer))
|
|
|
|
, impl_(std::make_unique<Impl>(*this))
|
2007-12-19 02:46:30 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
TorrentCellRenderer::~TorrentCellRenderer() = default;
|
2011-08-09 06:31:33 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
TorrentCellRenderer::Impl::Impl(TorrentCellRenderer& renderer)
|
2022-11-13 17:36:16 +00:00
|
|
|
: renderer_(renderer)
|
|
|
|
, property_torrent_(renderer, "torrent", nullptr)
|
|
|
|
, property_bar_height_(renderer, "bar-height", DefaultBarHeight)
|
|
|
|
, property_compact_(renderer, "compact", false)
|
|
|
|
, text_renderer_(Gtk::make_managed<Gtk::CellRendererText>())
|
|
|
|
, progress_renderer_(Gtk::make_managed<Gtk::CellRendererProgress>())
|
|
|
|
, icon_renderer_(Gtk::make_managed<Gtk::CellRendererPixbuf>())
|
|
|
|
{
|
2022-12-21 21:26:25 +00:00
|
|
|
renderer_.property_xpad() = GUI_PAD_SMALL;
|
|
|
|
renderer_.property_ypad() = GUI_PAD_SMALL;
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
text_renderer_->property_xpad() = 0;
|
|
|
|
text_renderer_->property_ypad() = 0;
|
2008-01-12 17:59:09 +00:00
|
|
|
}
|
|
|
|
|
2022-12-21 21:26:25 +00:00
|
|
|
Glib::PropertyProxy<Torrent*> TorrentCellRenderer::property_torrent()
|
2007-12-19 02:46:30 +00:00
|
|
|
{
|
2022-11-13 17:36:16 +00:00
|
|
|
return impl_->property_torrent().get_proxy();
|
2007-12-19 02:46:30 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
Glib::PropertyProxy<int> TorrentCellRenderer::property_bar_height()
|
|
|
|
{
|
2022-11-13 17:36:16 +00:00
|
|
|
return impl_->property_bar_height().get_proxy();
|
2007-12-19 02:46:30 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
Glib::PropertyProxy<bool> TorrentCellRenderer::property_compact()
|
2007-12-19 02:46:30 +00:00
|
|
|
{
|
2022-11-13 17:36:16 +00:00
|
|
|
return impl_->property_compact().get_proxy();
|
2007-12-19 02:46:30 +00:00
|
|
|
}
|