Make members header a button.

This commit is contained in:
John Preston 2017-11-17 19:34:51 +04:00
parent 88d7f172ca
commit fc4c31b673
3 changed files with 16 additions and 12 deletions

View File

@ -398,6 +398,7 @@ infoBlockButton: InfoProfileButton(infoProfileButton) {
infoBlockButtonSkip: 8px;
infoMembersHeader: 56px;
infoMembersHeaderPaddingBottom: 6px;
infoMembersList: PeerList(defaultPeerList) {
item: PeerListItem(defaultPeerListItem) {
photoPosition: point(18px, 6px);
@ -405,17 +406,15 @@ infoMembersList: PeerList(defaultPeerList) {
statusPosition: point(79px, 31px);
}
}
infoMembersButtonPosition: point(12px, 9px);
infoMembersButtonIconPosition: point(6px, 6px);
infoMembersButtonPosition: point(12px, 0px);
infoMembersButtonIconPosition: point(3px, 3px);
infoMembersButton: IconButton(defaultIconButton) {
width: 44px;
height: 44px;
width: 38px;
height: 38px;
iconPosition: infoMembersButtonIconPosition;
rippleAreaPosition: point(0px, 0px);
rippleAreaSize: 44px;
ripple: RippleAnimation(defaultRippleAnimation) {
color: windowBgOver;
}
rippleAreaSize: 38px;
ripple: defaultRippleAnimation;
}
infoMembersAddMember: IconButton(infoMembersButton) {
icon: icon {{ "info_add_member", menuIconFg }};

View File

@ -25,6 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "info/profile/info_profile_values.h"
#include "info/profile/info_profile_icon.h"
#include "info/profile/info_profile_values.h"
#include "info/profile/info_profile_button.h"
#include "info/profile/info_profile_members_controllers.h"
#include "info/info_content_widget.h"
#include "info/info_controller.h"
@ -122,16 +123,19 @@ void Members::setupHeader() {
st::infoMembersHeader);
auto parent = _header.data();
_openMembers = Ui::CreateChild<Button>(
parent,
rpl::single(QString()));
object_ptr<FloatingIcon>(
parent,
st::infoIconMembers,
st::infoIconPosition);
_openMembers = Ui::CreateChild<Ui::AbstractButton>(parent);
_titleWrap = Ui::CreateChild<Ui::RpWidget>(parent);
_title = setupTitle();
_addMember = Ui::CreateChild<Ui::IconButton>(
parent,
_openMembers,
st::infoMembersAddMember);
//_searchField = _controller->searchFieldController()->createField(
// parent,
@ -256,7 +260,7 @@ void Members::updateSearchEnabledByContent() {
}
void Members::updateHeaderControlsGeometry(int newWidth) {
_openMembers->setGeometry(0, 0, newWidth, st::infoMembersHeader);
_openMembers->setGeometry(0, st::infoProfileSkip, newWidth, st::infoMembersHeader - st::infoProfileSkip - st::infoMembersHeaderPaddingBottom);
auto availableWidth = newWidth
- st::infoMembersButtonPosition.x();

View File

@ -44,6 +44,7 @@ enum class Wrap;
namespace Profile {
class Button;
class Memento;
struct MembersState {
std::unique_ptr<PeerListState> list;
@ -129,7 +130,7 @@ private:
object_ptr<Ui::RpWidget> _header = { nullptr };
object_ptr<ListWidget> _list = { nullptr };
Ui::AbstractButton *_openMembers = nullptr;
Button *_openMembers = nullptr;
Ui::RpWidget *_titleWrap = nullptr;
Ui::FlatLabel *_title = nullptr;
Ui::IconButton *_addMember = nullptr;