Commit bcb3399f authored by Guido Gunther's avatar Guido Gunther
Browse files

Merge branch 'top-panel' into 'main'

Rename panel top top-panel

See merge request World/Phosh/phosh!887
parents 96204443 9ed901ad
......@@ -49,7 +49,7 @@ These are the most prominent ones use by Phosh:
- wlr-layer-shell: Usually Wayland clients have little influence on where
the compositor places them. This protocol gives Phosh enough room
to build the top bar via #PhoshPanel, the home bar #PhoshHome at
to build the top bar via #PhoshTopPanel, the home bar #PhoshHome at
the bottom, system modal dialogs e.g. #PhoshSystemPrompt and
lock screens via #PhoshLockscreen.
- wlr-foreign-toplevel-management: This allows the management of
......
......@@ -95,7 +95,6 @@
<xi:include href="xml/osk-manager.xml"/>
<xi:include href="xml/overview.xml"/>
<xi:include href="xml/osd-window.xml"/>
<xi:include href="xml/panel.xml"/>
<xi:include href="xml/phosh-wayland.xml"/>
<xi:include href="xml/phosh-wwan-backend.xml"/>
<xi:include href="xml/phosh-wwan-iface.xml"/>
......@@ -120,6 +119,7 @@
<xi:include href="xml/system-prompt.xml"/>
<xi:include href="xml/system-prompter.xml"/>
<xi:include href="xml/thumbnail.xml"/>
<xi:include href="xml/top-panel.xml"/>
<xi:include href="xml/toplevel.xml"/>
<xi:include href="xml/toplevel-manager.xml"/>
<xi:include href="xml/toplevel-thumbnail.xml"/>
......
......@@ -15,7 +15,7 @@
#include "background.h"
#include "shell.h"
#include "panel.h"
#include "top-panel.h"
#include "util.h"
#define GNOME_DESKTOP_USE_UNSTABLE_API
......
......@@ -171,8 +171,8 @@ libphosh_sources = files(
'osk-button.h',
'osk-manager.c',
'osk-manager.h',
'panel.c',
'panel.h',
'top-panel.c',
'top-panel.h',
'polkit-auth-agent.c',
'polkit-auth-agent.h',
'polkit-auth-prompt.c',
......
/*
* Copyright (C) 2018 Purism SPC
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include "layersurface.h"
#define PHOSH_TYPE_PANEL (phosh_panel_get_type ())
G_DECLARE_FINAL_TYPE (PhoshPanel, phosh_panel, PHOSH, PANEL, PhoshLayerSurface)
#define PHOSH_PANEL_HEIGHT 32
/**
* PhoshPanelState:
* @PHOSH_PANEL_STATE_FOLDED: Only top-bar is visible
* @PHOSH_PANEL_STATE_UNFOLDED: Settings menu is unfolded
*/
typedef enum {
PHOSH_PANEL_STATE_FOLDED,
PHOSH_PANEL_STATE_UNFOLDED,
} PhoshPanelState;
GtkWidget * phosh_panel_new (struct zwlr_layer_shell_v1 *layer_shell,
struct wl_output *wl_output);
void phosh_panel_toggle_fold (PhoshPanel *self);
void phosh_panel_fold (PhoshPanel *self);
void phosh_panel_unfold (PhoshPanel *self);
PhoshPanelState phosh_panel_get_state (PhoshPanel *self);
......@@ -55,7 +55,6 @@
#include "notifications/notify-manager.h"
#include "notifications/notification-banner.h"
#include "osk-manager.h"
#include "panel.h"
#include "phosh-wayland.h"
#include "polkit-auth-agent.h"
#include "proximity.h"
......@@ -67,6 +66,7 @@
#include "screenshot-manager.h"
#include "session-manager.h"
#include "system-prompter.h"
#include "top-panel.h"
#include "torch-manager.h"
#include "torch-info.h"
#include "util.h"
......@@ -82,7 +82,7 @@
* @Title: PhoshShell
*
* #PhoshShell is responsible for instantiating the GUI
* parts of the shell#PhoshPanel, #PhoshHome,… and the managers that
* parts of the shell#PhoshTopPanel, #PhoshHome,… and the managers that
* interface with DBus #PhoshMonitorManager, #PhoshFeedbackManager, …
* and coordinates between them.
*/
......@@ -165,13 +165,13 @@ G_DEFINE_TYPE_WITH_PRIVATE (PhoshShell, phosh_shell, G_TYPE_OBJECT)
static void
settings_activated_cb (PhoshShell *self,
PhoshPanel *window)
settings_activated_cb (PhoshShell *self,
PhoshTopPanel *window)
{
PhoshShellPrivate *priv = phosh_shell_get_instance_private (self);
g_return_if_fail (PHOSH_IS_PANEL (priv->panel));
phosh_panel_toggle_fold (PHOSH_PANEL(priv->panel));
g_return_if_fail (PHOSH_IS_TOP_PANEL (priv->panel));
phosh_top_panel_toggle_fold (PHOSH_TOP_PANEL(priv->panel));
}
......@@ -188,7 +188,7 @@ on_home_state_changed (PhoshShell *self, GParamSpec *pspec, PhoshHome *home)
g_object_get (priv->home, "state", &state, NULL);
if (state == PHOSH_HOME_STATE_UNFOLDED) {
phosh_panel_fold (PHOSH_PANEL (priv->panel));
phosh_top_panel_fold (PHOSH_TOP_PANEL (priv->panel));
phosh_osk_manager_set_visible (priv->osk_manager, FALSE);
}
phosh_shell_set_state (self, PHOSH_STATE_OVERVIEW, state == PHOSH_HOME_STATE_UNFOLDED);
......@@ -206,7 +206,7 @@ panels_create (PhoshShell *self)
monitor = phosh_shell_get_primary_monitor (self);
g_return_if_fail (monitor);
priv->panel = PHOSH_LAYER_SURFACE(phosh_panel_new (phosh_wayland_get_zwlr_layer_shell_v1(wl),
priv->panel = PHOSH_LAYER_SURFACE(phosh_top_panel_new (phosh_wayland_get_zwlr_layer_shell_v1(wl),
monitor->wl_output));
gtk_widget_show (GTK_WIDGET (priv->panel));
......@@ -435,7 +435,7 @@ on_new_notification (PhoshShell *self,
}
if (phosh_notify_manager_get_show_notification_banner (manager, notification) &&
phosh_panel_get_state (PHOSH_PANEL (priv->panel)) == PHOSH_PANEL_STATE_FOLDED &&
phosh_top_panel_get_state (PHOSH_TOP_PANEL (priv->panel)) == PHOSH_TOP_PANEL_STATE_FOLDED &&
!priv->locked) {
g_set_weak_pointer (&priv->notification_banner,
phosh_notification_banner_new (notification));
......@@ -1193,18 +1193,18 @@ phosh_shell_get_usable_area (PhoshShell *self, int *x, int *y, int *width, int *
case PHOSH_MONITOR_TRANSFORM_FLIPPED:
case PHOSH_MONITOR_TRANSFORM_FLIPPED_180:
w = mode->width / scale;
h = mode->height / scale - PHOSH_PANEL_HEIGHT - PHOSH_HOME_BUTTON_HEIGHT;
h = mode->height / scale - PHOSH_TOP_PANEL_HEIGHT - PHOSH_HOME_BUTTON_HEIGHT;
break;
default:
w = mode->height / scale;
h = mode->width / scale - PHOSH_PANEL_HEIGHT - PHOSH_HOME_BUTTON_HEIGHT;
h = mode->width / scale - PHOSH_TOP_PANEL_HEIGHT - PHOSH_HOME_BUTTON_HEIGHT;
break;
}
if (x)
*x = 0;
if (y)
*y = PHOSH_PANEL_HEIGHT;
*y = PHOSH_TOP_PANEL_HEIGHT;
if (width)
*width = w;
if (height)
......
This diff is collapsed.
/*
* Copyright (C) 2018 Purism SPC
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include "layersurface.h"
#define PHOSH_TYPE_TOP_PANEL (phosh_top_panel_get_type ())
G_DECLARE_FINAL_TYPE (PhoshTopPanel, phosh_top_panel, PHOSH, TOP_PANEL, PhoshLayerSurface)
#define PHOSH_TOP_PANEL_HEIGHT 32
/**
* PhoshTopPanelState:
* @PHOSH_TOP_PANEL_STATE_FOLDED: Only top-bar is visible
* @PHOSH_TOP_PANEL_STATE_UNFOLDED: Settings menu is unfolded
*/
typedef enum {
PHOSH_TOP_PANEL_STATE_FOLDED,
PHOSH_TOP_PANEL_STATE_UNFOLDED,
} PhoshTopPanelState;
GtkWidget *phosh_top_panel_new (struct zwlr_layer_shell_v1 *layer_shell,
struct wl_output *wl_output);
void phosh_top_panel_toggle_fold (PhoshTopPanel *self);
void phosh_top_panel_fold (PhoshTopPanel *self);
void phosh_top_panel_unfold (PhoshTopPanel *self);
PhoshTopPanelState phosh_top_panel_get_state (PhoshTopPanel *self);
......@@ -40,7 +40,7 @@
</object>
</child>
</object>
<template class="PhoshPanel" parent="PhoshLayerSurface">
<template class="PhoshTopPanel" parent="PhoshLayerSurface">
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="box">
......
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