Revert "Merge branch 'mobile-ui' into 'master'"

This reverts merge request !268
This commit is contained in:
Daniel Garcia Moreno 2018-11-14 18:05:36 +00:00
parent 6eff3180ea
commit 03fae4c636
10 changed files with 13 additions and 181 deletions

View file

@ -301,8 +301,3 @@ stack.titlebar:not(headerbar) > box > separator {
.small-font {
font-size: small;
}
box.folded-history > hdycolumn > list {
padding-left: 6px;
padding-right: 6px;
}

View file

@ -2,7 +2,6 @@
<!-- Generated with glade 3.20.2 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<requires lib="libhandy" version="0.0"/>
<object class="GtkApplicationWindow" id="main_window">
<property name="can_focus">False</property>
<property name="default_width">860</property>
@ -11,22 +10,16 @@
<child>
<object class="GtkStack" id="main_content_stack">
<property name="can_focus">False</property>
<property name="hhomogeneous">False</property>
<child>
<object class="HdyLeaflet" id="chat_state">
<property name="child-transition-duration" bind-source="header_leaflet" bind-property="child-transition-duration" bind-flags="bidirectional|sync-create"/>
<property name="child-transition-type" bind-source="header_leaflet" bind-property="child-transition-type" bind-flags="bidirectional|sync-create"/>
<property name="mode-transition-duration" bind-source="header_leaflet" bind-property="mode-transition-duration" bind-flags="bidirectional|sync-create"/>
<property name="mode-transition-type" bind-source="header_leaflet" bind-property="mode-transition-type" bind-flags="bidirectional|sync-create"/>
<object class="GtkBox" id="chat_state">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hhomogeneous-folded">True</property>
<child>
<object class="GtkBox" id="sidebar-box">
<property name="width_request">200</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">fill</property>
<property name="halign">start</property>
<property name="hexpand">False</property>
<property name="orientation">vertical</property>
<child>
@ -87,16 +80,15 @@
</child>
</object>
<packing>
<property name="name">sidebar-box</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="content_separator">
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can_focus">False</property>
<style>
<class name="sidebar"/>
</style>
</object>
<packing>
<property name="expand">False</property>
@ -286,7 +278,10 @@
</child>
</object>
<packing>
<property name="name">inapp</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</object>
@ -735,19 +730,14 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="hhomogeneous">False</property>
<child>
<object class="HdyLeaflet" id="header_leaflet"> <!--message view-->
<property name="child-transition-type">slide</property>
<property name="mode-transition-type">slide</property>
<object class="GtkBox"> <!--message view-->
<property name="visible">True</property>
<property name="hhomogeneous-folded">True</property>
<child>
<object class="GtkHeaderBar" id="left-header"> <!--left titlebar-->
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">fill</property>
<property name="show-close-button">True</property>
<!--<property name="show-close-button">True</property>-->
<child>
<object class="GtkMenuButton" id="main_menu_button">
<property name="visible">True</property>
@ -829,12 +819,9 @@
</object>
</child>
</object>
<packing>
<property name="name">left-header</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="header_separator">
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
@ -848,35 +835,6 @@
<property name="show-close-button">True</property>
<property name="has-subtitle">False</property>
<property name="hexpand">True</property>
<child>
<object class="GtkRevealer">
<property name="reveal-child" bind-source="header_leaflet" bind-property="folded" bind-flags="sync-create"/>
<property name="transition-duration" bind-source="header_leaflet" bind-property="mode-transition-duration" bind-flags="bidirectional|sync-create"/>
<property name="transition-type">crossfade</property>
<property name="visible">True</property>
<child>
<object class="GtkButton" id="room_header_back_button">
<property name="receives-default">False</property>
<property name="visible">True</property>
<style>
<class name="image-button"/>
</style>
<child internal-child="accessible">
<object class="AtkObject">
<property name="accessible-name" translatable="yes">Back</property>
</object>
</child>
<child>
<object class="GtkImage">
<property name="icon-name">go-previous-symbolic</property>
<property name="icon-size">1</property>
<property name="visible">True</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child type="title">
<object class="GtkBox" id="room_info">
<property name="visible">True</property>
@ -941,9 +899,6 @@
</packing>
</child>
</object>
<packing>
<property name="name">room_header_bar</property>
</packing>
</child>
</object>
<packing>
@ -1082,24 +1037,4 @@
<widget name="sidebar-box"/>
</widgets>
</object>
<object class="GtkSizeGroup">
<property name="mode">horizontal</property>
<widgets>
<widget name="room_header_bar"/>
<widget name="inapp"/>
</widgets>
</object>
<object class="GtkSizeGroup">
<property name="mode">horizontal</property>
<widgets>
<widget name="header_separator"/>
<widget name="content_separator"/>
</widgets>
</object>
<object class="HdyHeaderGroup">
<headerbars>
<headerbar name="left-header"/>
<headerbar name="room_header_bar"/>
</headerbars>
</object>
</interface>

View file

@ -2,7 +2,6 @@ use app::App;
use appop::MsgPos;
use appop::AppState;
use appop::LeafletState;
use std::thread;
use std::sync::mpsc::Receiver;
@ -21,7 +20,6 @@ pub enum InternalCommand {
SetView(AppState),
NotifyClicked(Message),
SelectRoom(Room),
ShowRoomList,
LoadMore,
LoadMoreNormal,
RemoveInv(String),
@ -56,15 +54,11 @@ pub fn appop_loop(rx: Receiver<InternalCommand>) {
APPOP!(set_state, (view));
}
Ok(InternalCommand::NotifyClicked(msg)) => {
let state = LeafletState::Content;
APPOP!(notification_cliked, (msg));
APPOP!(set_leaflet_state, (state));
}
Ok(InternalCommand::SelectRoom(r)) => {
let id = r.id;
let state = LeafletState::Content;
APPOP!(set_active_room_by_id, (id));
APPOP!(set_leaflet_state, (state));
}
Ok(InternalCommand::LoadMore) => {
APPOP!(load_more_messages);
@ -90,10 +84,6 @@ pub fn appop_loop(rx: Receiver<InternalCommand>) {
Ok(InternalCommand::PurchaseSticker(group)) => {
APPOP!(purchase_sticker, (group));
}
Ok(InternalCommand::ShowRoomList) => {
let state = LeafletState::Sidebar;
APPOP!(set_leaflet_state, (state));
}
Err(_) => {
break;
}

View file

@ -4,9 +4,6 @@ use gtk::prelude::*;
use appop::AppState;
use app::App;
use app::InternalCommand;
use std::sync::Arc;
impl App {
pub fn connect_headerbars(&self) {
@ -17,17 +14,6 @@ impl App {
btn.connect_clicked(move |_| {
op.lock().unwrap().set_state(AppState::Chat);
});
let back_btn = self.ui.builder
.get_object::<gtk::Button>("room_header_back_button")
.expect("Can't find room_header_back_button in ui file.");
let weak_op = Arc::downgrade(&self.op);
back_btn.connect_clicked(move |_| {
weak_op.upgrade().map(|op| {
op.lock().unwrap().internal.send(InternalCommand::ShowRoomList)
.unwrap();
});
});
if let Some(set) = gtk::Settings::get_default() {
let left_header: gtk::HeaderBar = self.ui.builder

View file

@ -1,26 +0,0 @@
use gtk::{self, prelude::*};
use libhandy::*;
use app::App;
impl App {
pub fn connect_leaflet(&self) {
let container = self.ui.builder
.get_object::<gtk::Box>("message_column")
.expect("Can't find message_column in ui file.");
let chat_state_leaflet: libhandy::Leaflet = self.ui.builder
.get_object("chat_state")
.expect("Can't find chat_state in ui file.");
let weak_container = container.downgrade();
chat_state_leaflet.connect_property_fold_notify(move |leaflet| {
weak_container.upgrade().map(|container| {
match leaflet.get_fold() {
Fold::Folded => container.get_style_context().unwrap().add_class("folded-history"),
Fold::Unfolded => container.get_style_context().unwrap().remove_class("folded-history"),
_ => ()
}
});
});
}
}

View file

@ -10,7 +10,6 @@ mod directory;
mod headerbar;
mod invite;
mod join_room;
mod leaflet;
mod leave_room;
mod login;
mod markdown;
@ -62,8 +61,6 @@ impl App {
self.connect_headerbars();
self.connect_login_view();
self.connect_leaflet();
self.connect_send();
self.connect_attach();
self.connect_markdown();

View file

@ -65,8 +65,6 @@ impl App {
let gtk_app = gtk::Application::new(Some(&appid[..]), gio::ApplicationFlags::empty())
.expect("Failed to initialize GtkApplication");
libhandy::Leaflet::get_type(&libhandy::Leaflet::new());
gtk_app.set_accels_for_action("app.quit", &["<Ctrl>Q"]);
let path = "/org/gnome/Fractal".to_string();

View file

@ -1,27 +0,0 @@
use libhandy::*;
use appop::AppOp;
use appop::RoomPanel;
#[derive(Clone, Debug)]
pub enum LeafletState {
Content,
Sidebar
}
impl AppOp {
pub fn set_leaflet_state(&mut self, state: LeafletState) {
match state {
LeafletState::Content => {
self.header_leaflet.set_visible_child_name("room_header_bar");
self.chat_state.set_visible_child_name("inapp");
},
LeafletState::Sidebar => {
self.room_panel(RoomPanel::NoRoom);
self.active_room = None;
self.header_leaflet.set_visible_child_name("left-header");
self.chat_state.set_visible_child_name("sidebar-box");
}
}
}
}

View file

@ -5,8 +5,6 @@ use gio::ApplicationExt;
use gtk;
use gtk::prelude::*;
use libhandy;
use globals;
use backend::BKCommand;
use backend;
@ -44,7 +42,6 @@ mod invite;
mod about;
mod start_chat;
mod stickers;
mod leaflet;
pub use self::state::AppState;
use self::message::TmpMsg;
@ -52,7 +49,6 @@ pub use self::message::MsgPos;
pub use self::message::LastViewed;
pub use self::room::RoomPanel;
use self::member::SearchType;
pub use self::leaflet::LeafletState;
pub struct AppOp {
pub ui: uibuilder::UI,
@ -81,8 +77,6 @@ pub struct AppOp {
pub roomlist: widgets::RoomList,
pub message_box: gtk::ListBox,
pub unsent_messages: HashMap<String, (String, i32)>,
pub header_leaflet: libhandy::Leaflet,
pub chat_state: libhandy::Leaflet,
pub inhibit_escape: bool,
@ -111,11 +105,6 @@ impl AppOp {
ui: uibuilder::UI,
tx: Sender<BKCommand>,
itx: Sender<InternalCommand>) -> AppOp {
let header_leaflet = ui.builder.get_object("header_leaflet")
.expect("could not find header_leaflet in .ui file");
let chat_state = ui.builder.get_object("chat_state")
.expect("could not find chat_state in .ui file");
AppOp {
ui: ui,
gtk_app: app,
@ -143,8 +132,6 @@ impl AppOp {
since: None,
member_limit: 50,
unsent_messages: HashMap::new(),
header_leaflet,
chat_state,
inhibit_escape: false,

View file

@ -3,7 +3,6 @@ use gtk::prelude::*;
use appop::AppOp;
use appop::room::RoomPanel;
use appop::LeafletState;
#[derive(Debug, Clone, PartialEq)]
@ -90,8 +89,6 @@ impl AppOp {
self.room_panel(RoomPanel::NoRoom);
self.active_room = None;
self.clear_tmp_msgs();
self.set_leaflet_state(LeafletState::Sidebar);
true
},
_ => { false }