mirror of https://github.com/procxx/kepka.git
Make members header a button.
This commit is contained in:
parent
88d7f172ca
commit
fc4c31b673
|
@ -398,6 +398,7 @@ infoBlockButton: InfoProfileButton(infoProfileButton) {
|
||||||
infoBlockButtonSkip: 8px;
|
infoBlockButtonSkip: 8px;
|
||||||
|
|
||||||
infoMembersHeader: 56px;
|
infoMembersHeader: 56px;
|
||||||
|
infoMembersHeaderPaddingBottom: 6px;
|
||||||
infoMembersList: PeerList(defaultPeerList) {
|
infoMembersList: PeerList(defaultPeerList) {
|
||||||
item: PeerListItem(defaultPeerListItem) {
|
item: PeerListItem(defaultPeerListItem) {
|
||||||
photoPosition: point(18px, 6px);
|
photoPosition: point(18px, 6px);
|
||||||
|
@ -405,17 +406,15 @@ infoMembersList: PeerList(defaultPeerList) {
|
||||||
statusPosition: point(79px, 31px);
|
statusPosition: point(79px, 31px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
infoMembersButtonPosition: point(12px, 9px);
|
infoMembersButtonPosition: point(12px, 0px);
|
||||||
infoMembersButtonIconPosition: point(6px, 6px);
|
infoMembersButtonIconPosition: point(3px, 3px);
|
||||||
infoMembersButton: IconButton(defaultIconButton) {
|
infoMembersButton: IconButton(defaultIconButton) {
|
||||||
width: 44px;
|
width: 38px;
|
||||||
height: 44px;
|
height: 38px;
|
||||||
iconPosition: infoMembersButtonIconPosition;
|
iconPosition: infoMembersButtonIconPosition;
|
||||||
rippleAreaPosition: point(0px, 0px);
|
rippleAreaPosition: point(0px, 0px);
|
||||||
rippleAreaSize: 44px;
|
rippleAreaSize: 38px;
|
||||||
ripple: RippleAnimation(defaultRippleAnimation) {
|
ripple: defaultRippleAnimation;
|
||||||
color: windowBgOver;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
infoMembersAddMember: IconButton(infoMembersButton) {
|
infoMembersAddMember: IconButton(infoMembersButton) {
|
||||||
icon: icon {{ "info_add_member", menuIconFg }};
|
icon: icon {{ "info_add_member", menuIconFg }};
|
||||||
|
|
|
@ -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_values.h"
|
||||||
#include "info/profile/info_profile_icon.h"
|
#include "info/profile/info_profile_icon.h"
|
||||||
#include "info/profile/info_profile_values.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/profile/info_profile_members_controllers.h"
|
||||||
#include "info/info_content_widget.h"
|
#include "info/info_content_widget.h"
|
||||||
#include "info/info_controller.h"
|
#include "info/info_controller.h"
|
||||||
|
@ -122,16 +123,19 @@ void Members::setupHeader() {
|
||||||
st::infoMembersHeader);
|
st::infoMembersHeader);
|
||||||
auto parent = _header.data();
|
auto parent = _header.data();
|
||||||
|
|
||||||
|
_openMembers = Ui::CreateChild<Button>(
|
||||||
|
parent,
|
||||||
|
rpl::single(QString()));
|
||||||
|
|
||||||
object_ptr<FloatingIcon>(
|
object_ptr<FloatingIcon>(
|
||||||
parent,
|
parent,
|
||||||
st::infoIconMembers,
|
st::infoIconMembers,
|
||||||
st::infoIconPosition);
|
st::infoIconPosition);
|
||||||
|
|
||||||
_openMembers = Ui::CreateChild<Ui::AbstractButton>(parent);
|
|
||||||
_titleWrap = Ui::CreateChild<Ui::RpWidget>(parent);
|
_titleWrap = Ui::CreateChild<Ui::RpWidget>(parent);
|
||||||
_title = setupTitle();
|
_title = setupTitle();
|
||||||
_addMember = Ui::CreateChild<Ui::IconButton>(
|
_addMember = Ui::CreateChild<Ui::IconButton>(
|
||||||
parent,
|
_openMembers,
|
||||||
st::infoMembersAddMember);
|
st::infoMembersAddMember);
|
||||||
//_searchField = _controller->searchFieldController()->createField(
|
//_searchField = _controller->searchFieldController()->createField(
|
||||||
// parent,
|
// parent,
|
||||||
|
@ -256,7 +260,7 @@ void Members::updateSearchEnabledByContent() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Members::updateHeaderControlsGeometry(int newWidth) {
|
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
|
auto availableWidth = newWidth
|
||||||
- st::infoMembersButtonPosition.x();
|
- st::infoMembersButtonPosition.x();
|
||||||
|
|
|
@ -44,6 +44,7 @@ enum class Wrap;
|
||||||
|
|
||||||
namespace Profile {
|
namespace Profile {
|
||||||
|
|
||||||
|
class Button;
|
||||||
class Memento;
|
class Memento;
|
||||||
struct MembersState {
|
struct MembersState {
|
||||||
std::unique_ptr<PeerListState> list;
|
std::unique_ptr<PeerListState> list;
|
||||||
|
@ -129,7 +130,7 @@ private:
|
||||||
object_ptr<Ui::RpWidget> _header = { nullptr };
|
object_ptr<Ui::RpWidget> _header = { nullptr };
|
||||||
object_ptr<ListWidget> _list = { nullptr };
|
object_ptr<ListWidget> _list = { nullptr };
|
||||||
|
|
||||||
Ui::AbstractButton *_openMembers = nullptr;
|
Button *_openMembers = nullptr;
|
||||||
Ui::RpWidget *_titleWrap = nullptr;
|
Ui::RpWidget *_titleWrap = nullptr;
|
||||||
Ui::FlatLabel *_title = nullptr;
|
Ui::FlatLabel *_title = nullptr;
|
||||||
Ui::IconButton *_addMember = nullptr;
|
Ui::IconButton *_addMember = nullptr;
|
||||||
|
|
Loading…
Reference in New Issue