Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-client-uwp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Automate
Agent sessions
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is archived. Its data is
read-only
.
Show more breadcrumbs
savoirfairelinux
jami-client-uwp
Commits
f3ad2c07
Commit
f3ad2c07
authored
Oct 26, 2016
by
Nicolas Jager
Browse files
Options
Downloads
Patches
Plain Diff
profil : allows to take a picture by clicking on the avatar
Change-Id: I8da2ece803a90981a1ccea352df9f6f2ed084535 Tuleap: #1250
parent
0a7b77df
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
SmartPanel.xaml
+23
-0
23 additions, 0 deletions
SmartPanel.xaml
SmartPanel.xaml.cpp
+66
-0
66 additions, 0 deletions
SmartPanel.xaml.cpp
SmartPanel.xaml.h
+3
-0
3 additions, 0 deletions
SmartPanel.xaml.h
Styles.xaml
+13
-0
13 additions, 0 deletions
Styles.xaml
with
105 additions
and
0 deletions
SmartPanel.xaml
+
23
−
0
View file @
f3ad2c07
...
@@ -379,6 +379,11 @@
...
@@ -379,6 +379,11 @@
Height="80"
Height="80"
Width="80"
Width="80"
Grid.Column="0"
Grid.Column="0"
Stroke="White"
StrokeThickness="3"
PointerEntered="_selectedAccountAvatarContainer__PointerEntered"
PointerExited="_selectedAccountAvatarContainer__PointerExited"
PointerReleased="_selectedAccountAvatarContainer__PointerReleased"
Margin="5">
Margin="5">
<Ellipse.Fill>
<Ellipse.Fill>
<ImageBrush
<ImageBrush
...
@@ -386,6 +391,24 @@
...
@@ -386,6 +391,24 @@
ImageSource="Assets\TESTS\contactAvatar.png"/>
ImageSource="Assets\TESTS\contactAvatar.png"/>
</Ellipse.Fill>
</Ellipse.Fill>
</Ellipse>
</Ellipse>
<Ellipse
x:Name="_shaderPhotoboothIcon_"
Visibility="Collapsed"
Height="80"
Width="80"
Grid.Column="0"
IsHitTestVisible="False"
Fill="Black"
Opacity="0.3"
Margin="5">
</Ellipse>
<TextBlock x:Name="_photoboothIcon_"
Grid.Column="0"
Visibility="Collapsed"
IsHitTestVisible="False"
Style="{StaticResource TextSegoeStyle-Centered-40pt-white}"
Text="">
</TextBlock>
<StackPanel Grid.Column="1"
<StackPanel Grid.Column="1"
VerticalAlignment="Bottom">
VerticalAlignment="Bottom">
<TextBlock x:Name="_selectedAccountName_"
<TextBlock x:Name="_selectedAccountName_"
...
...
This diff is collapsed.
Click to expand it.
SmartPanel.xaml.cpp
+
66
−
0
View file @
f3ad2c07
...
@@ -206,17 +206,20 @@ void RingClientUWP::Views::SmartPanel::setMode(RingClientUWP::Views::SmartPanel:
...
@@ -206,17 +206,20 @@ void RingClientUWP::Views::SmartPanel::setMode(RingClientUWP::Views::SmartPanel:
if
(
mode
==
RingClientUWP
::
Views
::
SmartPanel
::
Mode
::
Normal
)
{
if
(
mode
==
RingClientUWP
::
Views
::
SmartPanel
::
Mode
::
Normal
)
{
_rowRingTxtBx_
->
Height
=
40
;
_rowRingTxtBx_
->
Height
=
40
;
_selectedAccountAvatarContainer_
->
Height
=
80
;
_selectedAccountAvatarContainer_
->
Height
=
80
;
_shaderPhotoboothIcon_
->
Height
=
80
;
_selectedAccountAvatarColumn_
->
Width
=
90
;
_selectedAccountAvatarColumn_
->
Width
=
90
;
_selectedAccountRow_
->
Height
=
90
;
_selectedAccountRow_
->
Height
=
90
;
}
}
else
{
else
{
_rowRingTxtBx_
->
Height
=
0
;
_rowRingTxtBx_
->
Height
=
0
;
_selectedAccountAvatarContainer_
->
Height
=
50
;
_selectedAccountAvatarContainer_
->
Height
=
50
;
_shaderPhotoboothIcon_
->
Height
=
50
;
_selectedAccountAvatarColumn_
->
Width
=
60
;
_selectedAccountAvatarColumn_
->
Width
=
60
;
_selectedAccountRow_
->
Height
=
60
;
_selectedAccountRow_
->
Height
=
60
;
}
}
_selectedAccountAvatarContainer_
->
Width
=
_selectedAccountAvatarContainer_
->
Height
;
_selectedAccountAvatarContainer_
->
Width
=
_selectedAccountAvatarContainer_
->
Height
;
_shaderPhotoboothIcon_
->
Width
=
_shaderPhotoboothIcon_
->
Height
;
_settingsTBtn_
->
IsChecked
=
false
;
_settingsTBtn_
->
IsChecked
=
false
;
_accountsMenuButton_
->
IsChecked
=
false
;
_accountsMenuButton_
->
IsChecked
=
false
;
_shareMenuButton_
->
IsChecked
=
false
;
_shareMenuButton_
->
IsChecked
=
false
;
...
@@ -858,3 +861,66 @@ Object ^ RingClientUWP::Views::CollapseEmptyString::ConvertBack(Object ^ value,
...
@@ -858,3 +861,66 @@ Object ^ RingClientUWP::Views::CollapseEmptyString::ConvertBack(Object ^ value,
RingClientUWP
::
Views
::
CollapseEmptyString
::
CollapseEmptyString
()
RingClientUWP
::
Views
::
CollapseEmptyString
::
CollapseEmptyString
()
{}
{}
void
RingClientUWP
::
Views
::
SmartPanel
::
_selectedAccountAvatarContainer__PointerEntered
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Input
::
PointerRoutedEventArgs
^
e
)
{
_photoboothIcon_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_shaderPhotoboothIcon_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
}
void
RingClientUWP
::
Views
::
SmartPanel
::
_selectedAccountAvatarContainer__PointerReleased
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Input
::
PointerRoutedEventArgs
^
e
)
{
CameraCaptureUI
^
cameraCaptureUI
=
ref
new
CameraCaptureUI
();
cameraCaptureUI
->
PhotoSettings
->
Format
=
CameraCaptureUIPhotoFormat
::
Png
;
cameraCaptureUI
->
PhotoSettings
->
CroppedSizeInPixels
=
Size
(
100
,
100
);
create_task
(
cameraCaptureUI
->
CaptureFileAsync
(
CameraCaptureUIMode
::
Photo
))
.
then
([
this
](
StorageFile
^
photoFile
)
{
if
(
photoFile
!=
nullptr
)
{
// maybe it would be possible to move some logics to the style sheet
auto
brush
=
ref
new
ImageBrush
();
auto
circle
=
ref
new
Ellipse
();
circle
->
Height
=
80
;
// TODO : use some global constant when ready
circle
->
Width
=
80
;
auto
path
=
photoFile
->
Path
;
auto
uri
=
ref
new
Windows
::
Foundation
::
Uri
(
path
);
auto
bitmapImage
=
ref
new
Windows
::
UI
::
Xaml
::
Media
::
Imaging
::
BitmapImage
();
bitmapImage
->
UriSource
=
uri
;
StorageFolder
^
localfolder
=
ApplicationData
::
Current
->
LocalFolder
;
String
^
profilefolder
=
".profile"
;
create_task
(
localfolder
->
CreateFolderAsync
(
profilefolder
,
Windows
::
Storage
::
CreationCollisionOption
::
OpenIfExists
))
.
then
([
=
](
StorageFolder
^
copytofolder
)
{
try
{
create_task
(
photoFile
->
CopyAsync
(
copytofolder
))
.
then
([
=
](
StorageFile
^
copiedfile
)
{
copiedfile
->
RenameAsync
(
"profile_image.png"
,
Windows
::
Storage
::
NameCollisionOption
::
ReplaceExisting
);
});
}
catch
(
Exception
^
e
)
{
RingDebug
::
instance
->
print
(
"Exception while saving profile image"
);
}
});
Configuration
::
UserPreferences
::
instance
->
PREF_PROFILE_PHOTO
=
true
;
Configuration
::
UserPreferences
::
instance
->
save
();
brush
->
ImageSource
=
bitmapImage
;
_selectedAccountAvatar_
->
ImageSource
=
bitmapImage
;
}
});
}
void
RingClientUWP
::
Views
::
SmartPanel
::
_selectedAccountAvatarContainer__PointerExited
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Input
::
PointerRoutedEventArgs
^
e
)
{
_photoboothIcon_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_shaderPhotoboothIcon_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
}
This diff is collapsed.
Click to expand it.
SmartPanel.xaml.h
+
3
−
0
View file @
f3ad2c07
...
@@ -133,6 +133,9 @@ private:
...
@@ -133,6 +133,9 @@ private:
void
_passwordBoxAccountCreationCheck__PasswordChanged
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
void
_passwordBoxAccountCreationCheck__PasswordChanged
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
void
_accountTypeComboBox__SelectionChanged
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Controls
::
SelectionChangedEventArgs
^
e
);
void
_accountTypeComboBox__SelectionChanged
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Controls
::
SelectionChangedEventArgs
^
e
);
void
_ringAliasTextBox__TextChanged
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Controls
::
TextChangedEventArgs
^
e
);
void
_ringAliasTextBox__TextChanged
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Controls
::
TextChangedEventArgs
^
e
);
void
_selectedAccountAvatarContainer__PointerEntered
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Input
::
PointerRoutedEventArgs
^
e
);
void
_selectedAccountAvatarContainer__PointerReleased
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Input
::
PointerRoutedEventArgs
^
e
);
void
_selectedAccountAvatarContainer__PointerExited
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Input
::
PointerRoutedEventArgs
^
e
);
};
};
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Styles.xaml
+
13
−
0
View file @
f3ad2c07
...
@@ -117,6 +117,19 @@
...
@@ -117,6 +117,19 @@
<Setter Property="Foreground"
<Setter Property="Foreground"
Value="Black"/>
Value="Black"/>
</Style>
</Style>
<Style x:Key="TextSegoeStyle-Centered-40pt-white"
TargetType="TextBlock">
<Setter Property="FontFamily"
Value="Segoe MDL2 Assets"/>
<Setter Property="FontSize"
Value="40"/>
<Setter Property="HorizontalAlignment"
Value="Center"/>
<Setter Property="VerticalAlignment"
Value="Center"/>
<Setter Property="Foreground"
Value="White"/>
</Style>
<Style x:Key="ButtonStyle1"
<Style x:Key="ButtonStyle1"
TargetType="Button">
TargetType="Button">
<Setter Property="Width"
<Setter Property="Width"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment