Commit d4c67094 authored by Felix Häcker's avatar Felix Häcker

Use GtkButton instead of GtkEventBox to make flowbox scrollable on touchscreens

parent 97e64a73
......@@ -614,7 +614,7 @@ dependencies = [
[[package]]
name = "gstreamer"
version = "0.14.3"
version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -663,7 +663,7 @@ dependencies = [
"glib 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gstreamer 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)",
"gstreamer 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)",
"gstreamer-pbutils-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -1753,7 +1753,7 @@ dependencies = [
"glib 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gstreamer 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)",
"gstreamer 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)",
"gstreamer-pbutils 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gtk 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"indexmap 1.1.0 (git+https://github.com/bluss/indexmap.git?rev=380e55c6a330b03f554f59ebd01c075bf396dd47)",
......@@ -2324,7 +2324,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum glib 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "91a70db179515473b57aaff8b879167f1f8460bc5523e97beacf6d1026a8b99d"
"checksum glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4b86a9169fbc9cf9a0ef315039c2304b09d5c575c5fde7defba3576a0311b863"
"checksum gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "61d55bc9202447ca776f6ad0048c36e3312010f66f82ab478e97513e93f3604b"
"checksum gstreamer 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e0735df1994c5851322516f5924f0305d9afc5e41661c88714647cf5382a7980"
"checksum gstreamer 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa91e470b0cd4b05611f7d0e89caf76e39752156440877f04c23ad34ffc9761c"
"checksum gstreamer-audio-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "03c8b1cc44e9df434e1817ee00bfa5cb146008cacfcfbd88de4a0dac90b04496"
"checksum gstreamer-base-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9ba1955ea091323c17fdf8ff54fd7cf3dfed1a6035193ba08f85eb76bf549056"
"checksum gstreamer-pbutils 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17713f529d92459d5a5e4aa81a2d6778502ce2b6f92968645a7f1eedc811b155"
......
......@@ -12,7 +12,7 @@ gobject-sys = "0.9.0"
glib-sys = "0.9.0"
gio = { version = "0.7.0", features = ["v2_46"] }
gdk = "0.11.0"
gstreamer = "0.14.3"
gstreamer = "0.14.5"
gstreamer-pbutils = "0.14.0"
mpris-player = "0.4.0"
log = "0.4.7"
......
......@@ -32,6 +32,8 @@
<object class="GtkSearchEntry" id="search_entry">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="margin_left">7</property>
<property name="margin_right">7</property>
</object>
</child>
</object>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.0 -->
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkFlowBoxChild" id="station_row">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkEventBox" id="eventbox">
<object class="GtkButton" id="button">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="border_width">12</property>
<property name="spacing">6</property>
<child>
<object class="GtkRevealer" id="selection_mode_revealer">
<property name="can_focus">False</property>
<property name="transition_type">slide-right</property>
<child>
<object class="GtkCheckButton" id="check_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkImage" id="station_favicon">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixel_size">32</property>
<property name="icon_name">emblem-music-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="spacing">6</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkRevealer" id="selection_mode_revealer">
<object class="GtkLabel" id="station_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="transition_type">slide-right</property>
<child>
<object class="GtkCheckButton" id="check_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="draw_indicator">True</property>
<child>
<placeholder/>
</child>
</object>
</child>
<property name="halign">start</property>
<property name="label" translatable="yes">label</property>
<property name="wrap">True</property>
<property name="wrap_mode">char</property>
<property name="ellipsize">end</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkImage" id="station_favicon">
<object class="GtkLabel" id="subtitle_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixel_size">32</property>
<property name="icon_name">emblem-music-symbolic</property>
<property name="halign">start</property>
<property name="label" translatable="yes">label</property>
<property name="wrap">True</property>
<property name="wrap_mode">char</property>
<property name="ellipsize">end</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="play_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="valign">center</property>
<child>
<object class="GtkBox">
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="station_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">label</property>
<property name="wrap">True</property>
<property name="wrap_mode">char</property>
<property name="ellipsize">end</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="subtitle_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">label</property>
<property name="wrap">True</property>
<property name="wrap_mode">char</property>
<property name="ellipsize">end</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="play_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="valign">center</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">media-playback-start-symbolic</property>
</object>
</child>
<style>
<class name="image-button"/>
</style>
<property name="icon_name">media-playback-start-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">3</property>
</packing>
</child>
<style>
<class name="image-button"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="pack_type">end</property>
<property name="position">3</property>
</packing>
</child>
</object>
</child>
<style>
<class name="tile"/>
</style>
</object>
</child>
<style>
<class name="tile"/>
</style>
</object>
</interface>
......@@ -7,15 +7,20 @@
}
.tile {
border-radius: 5px;
padding: 1px;
border-radius: 6px;
border: 1px solid @borders;
color: @theme_fg_color;
box-shadow: 0 1px 2px rgba(0,0,0,0.07);
background-color: @theme_base_color;
color: @theme_fg_color;
box-shadow: 0 1px 2px rgba(0,0,0,0.1);
background: @theme_base_color;
}
.tile:hover {
background: @theme_bg_color;
background-color: @theme_base_color;
}
.tile:backdrop {
box-shadow: inset 0 1px 2px transparent;
}
.cover {
......
......@@ -47,23 +47,16 @@ impl StationRow {
sender.send(Action::PlaybackSetStation(station.clone())).unwrap();
});
// eventbox
// button
let station = self.station.clone();
let app = self.app.clone();
let eventbox: gtk::EventBox = self.builder.get_object("eventbox").unwrap();
let button: gtk::Button = self.builder.get_object("button").unwrap();
let check_button: gtk::CheckButton = self.builder.get_object("check_button").unwrap();
let sender = self.sender.clone();
eventbox.connect_button_press_event(move |_, button| {
// 3 -> Right mouse button
if button.get_button() == 3 {
// TODO: enable selection mode
check_button.set_active(true);
} else {
let window = app.get_active_window().unwrap();
let station_dialog = StationDialog::new(sender.clone(), station.clone(), &window);
station_dialog.show();
}
gtk::Inhibit(false)
button.connect_clicked(move |_| {
let window = app.get_active_window().unwrap();
let station_dialog = StationDialog::new(sender.clone(), station.clone(), &window);
station_dialog.show();
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment