Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
leolost2605 committed Jul 10, 2024
1 parent 31458fd commit d2fab42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 27 deletions.
22 changes: 1 addition & 21 deletions src/Services/PopoverManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public class Wingpanel.Services.PopoverManager : Object {
_current_indicator.base_indicator.closed ();
_current_indicator = null;
} else if (_current_indicator.base_indicator.code_name == value.base_indicator.code_name) { // Close due to toggle
return;
_current_indicator.base_indicator.closed ();
_current_indicator = null;
} else { // Switch
Expand Down Expand Up @@ -119,29 +118,10 @@ public class Wingpanel.Services.PopoverManager : Object {

public void register_indicator (Wingpanel.Widgets.IndicatorEntry? widg) {
if (registered_indicators.has_key (widg.base_indicator.code_name)) {
warning ("HAS KEy: %s", widg.base_indicator.code_name);
return;
}
warning ("Register indicator: %s", widg.base_indicator.code_name);
registered_indicators.set (widg.base_indicator.code_name, widg);

// widg.enter_notify_event.connect ((w, e) => {
// if (mousing) {
// return Gdk.EVENT_PROPAGATE;
// }

// if (grabbed) {
// if (!get_visible (widg) && e.mode != Gdk.CrossingMode.TOUCH_BEGIN) {
// mousing = true;
// current_indicator = widg;
// mousing = false;
// }

// return Gdk.EVENT_STOP;
// }

// return Gdk.EVENT_PROPAGATE;
// });
registered_indicators.set (widg.base_indicator.code_name, widg);

widg.notify["visible"].connect (() => {
if (mousing || grabbed) {
Expand Down
8 changes: 2 additions & 6 deletions src/Widgets/IndicatorEntry.vala
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public class Wingpanel.Widgets.IndicatorEntry : Gtk.Box {

private Gtk.Revealer revealer;

private Gtk.GestureClick gesture_press;

public IndicatorEntry (Indicator base_indicator, Services.PopoverManager popover_manager) {
Object (
base_indicator: base_indicator,
Expand Down Expand Up @@ -91,19 +89,17 @@ public class Wingpanel.Widgets.IndicatorEntry : Gtk.Box {
}
});

gesture_press = new Gtk.GestureClick ();
var gesture_press = new Gtk.GestureClick ();
gesture_press.pressed.connect ((n_press) => {
popover_manager.current_indicator = this;
warning ("PRESS");
});
add_controller (gesture_press);

var motion_controller = new Gtk.EventControllerMotion ();
motion_controller.enter.connect (() => {
if (popover_manager.current_indicator != null) {
if (popover_manager.current_indicator != null && popover_manager.current_indicator != this) {
popover_manager.current_indicator = this;
}
warning ("ENTER");
});
add_controller (motion_controller);

Expand Down

0 comments on commit d2fab42

Please sign in to comment.