Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 53 additions & 12 deletions data/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,37 @@
border-radius: 3px;
color: #41A6B5;
}
.excellent {
.excellent>label
{
color: #00ff00;
}

.good {
.good>label
{
color: #88ff00;
}

.ok {
.ok>label
{
color: #ffff00;
}

.weak {
.weak>label
{
color: #ff8800;
}

.none {
.none>label
{
color: #ff0000;
}
.bluetooth>label
{
color: #8888ff;
}

.wf-dock,
.wf-dock .out-box {
.wf-dock>.out-box {
background: transparent;
}

Expand All @@ -104,48 +113,80 @@
border-radius: 1em;
}

.wf-dock button {
.wf-dock button.toplevel-icon {
background: transparent;
padding-left: 0rem;
padding-right: 0rem;
}

.wf-dock button.activated {
.wf-dock .box button.activated {
border-bottom: 3px solid white;
margin-bottom: 5px;
}

.wf-dock image {
.wf-dock .box image {
background: transparent;
padding-left: 0rem;
padding-right: 0rem;
transition: 200ms;
-gtk-icon-transform: scale(0.7);
}

.wf-dock image:hover {
.wf-dock .box image:hover {
background: transparent;
padding-left: 0rem;
padding-right: 0rem;
transition: 200ms;
-gtk-icon-transform: scale(1.0);
}

.wf-dock image {
.wf-dock .box image.toplevel-icon {
animation-name: embiggen;
animation-duration: 1000ms;
animation-timing-function: linear;
animation-iteration-count: 1;
}

.wf-dock .closing image {
.wf-dock .box .closing image.toplevel-icon {
animation-name: kromulent;
animation-duration: 1000ms;
animation-timing-function: linear;
animation-iteration-count: 1;
animation-fill-mode: forwards;
}

.wf-dock .network .image-button{
-gtk-icon-size:64px;
}

.wf-dock .network-control-center {
-gtk-icon-size: 48px;
}

.network-control-center image.access-point {
-gtk-icon-size: 40px;
}

.network-control-center .access-point.secure .security {
-gtk-icon-size:20px;
color:red;
}

.network-control-center .access-point.secure.has-password .security {
color:green;
}

.network-control-center .access-point.has-password{
font-weight: bold;
background: #8f83;
}


.network-control-center .access-point .band {
font-size: 1em;
font-weight: bolder;
}

@keyframes embiggen {
to {
-gtk-icon-size: 64px;
Expand Down
4 changes: 4 additions & 0 deletions metadata/dock.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@
<_long>Keep all window icons for up to 2 seconds to allow CSS animations.</_long>
<default>true</default>
</option>
<option name="show_network_status" type="bool">
<_short>Show network status</_short>
<default>false</default>
</option>
</plugin>
</wf-shell>
4 changes: 4 additions & 0 deletions metadata/panel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@
<_short>On Click Command</_short>
<default>default</default>
</option>
<option name="network_no_label" type="bool">
<_short>No text</_short>
<default>false</default>
</option>
</group>
<group>
<_short>Menu</_short>
Expand Down
38 changes: 38 additions & 0 deletions src/dock/dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
#include <gdk/wayland/gdkwayland.h>

#include <gtk-utils.hpp>
#include <memory>
#include <wf-shell-app.hpp>
#include <gtk4-layer-shell.h>
#include <wf-autohide-window.hpp>

#include "dock.hpp"
#include "../util/gtk-utils.hpp"
#include "network/manager.hpp"
#include "network/network-widget.hpp"
#include "network/network.hpp"
#include <css-config.hpp>


Expand All @@ -20,13 +24,19 @@ class WfDock::impl
wl_surface *_wl_surface;
Gtk::Box out_box;
Gtk::Box box;
std::unique_ptr<WayfireMenuButton> network_image;
std::unique_ptr<NetworkControlWidget> network_control;
std::shared_ptr<NetworkManager> network_manager;

WfOption<std::string> css_path{"dock/css_path"};
WfOption<int> dock_height{"dock/dock_height"};
WfOption<bool> network{"dock/show_network_status"};

public:
impl(WayfireOutput *output)
{
network_image = std::make_unique<WayfireMenuButton>("dock");

this->output = output;
window = std::unique_ptr<WayfireAutohidingWindow>(
new WayfireAutohidingWindow(output, "dock"));
Expand Down Expand Up @@ -55,6 +65,34 @@ class WfDock::impl
}
}

if (network)
{
network_manager = NetworkManager::getInstance();
add_child(*network_image);
network_control = std::make_unique<NetworkControlWidget>();
network_image->get_popover()->set_child(*network_control);
network_image->set_has_frame(false);
network_manager->signal_default_changed().connect(
[this] (std::shared_ptr<Network> network)
{
network_image->set_icon_name(network->get_icon_name());
for (auto clas : network_image->get_css_classes())
{
network_image->remove_css_class(clas);
}

for (auto clas : network->get_css_classes())
{
network_image->add_css_class(clas);
}

network_image->set_tooltip_text(network->get_name());

network_image->add_css_class("network");
network_image->add_css_class("flat");
});
}

window->present();
_wl_surface = gdk_wayland_surface_get_wl_surface(
window->get_surface()->gobj());
Expand Down
2 changes: 2 additions & 0 deletions src/dock/dock.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#pragma once

#include <gtkmm/box.h>
#include <memory>
#include <wayland-client.h>
#include <wlr-foreign-toplevel-management-unstable-v1-client-protocol.h>
#include <wf-option-wrap.hpp>

#include "network/manager.hpp"
#include "wf-shell-app.hpp"

class WfDock
Expand Down
2 changes: 2 additions & 0 deletions src/panel/panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <css-config.hpp>
#include "panel.hpp"

#include "network/manager.hpp"
#include "widgets/battery.hpp"
#include "widgets/command-output.hpp"
#include "widgets/language.hpp"
Expand Down Expand Up @@ -243,6 +244,7 @@ class WayfirePanel::impl
{
const auto lock_sn_watcher = Watcher::Instance();
const auto lock_notification_daemon = Daemon::Instance();
const auto lock_network_manager = NetworkManager::getInstanceIfExists();
for (auto child : box.get_children())
{
box.remove(*child);
Expand Down
Loading
Loading